{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_0_23", "question": "\nimport org.junit.Test;\n package me.codegc.apet.", "target": "server;\n", "answers": ["server;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org junit Test Test01 Test test01 count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_2_7", "question": "\n/**\n package me.codegc.apet.server;\n\nimport ", "target": "org.junit.Test;\n", "answers": ["org.junit.Test;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test01 Test test01 count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_11_7", "question": "\n\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic ", "target": "class Test01 {\n", "answers": ["class Test01 {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test test01 count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_14_2", "question": "    public void test01() {\n        int count = 0;\n \n\n  ", "target": "  @Test\n", "answers": ["  @Test\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "test01 count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_15_16", "question": "        int count = 0;\n        while (true) {\n \n    @Test\n    public void ", "target": "test01() {\n", "answers": ["test01() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_16_12", "question": "        while (true) {\n            count++;\n     @Test\n    public void test01() {\n        int ", "target": "count = 0;\n", "answers": ["count = 0;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_17_8", "question": "            count++;\n            System.out.println(count);\n     public void test01() {\n        int count = 0;\n        ", "target": "while (true) {\n", "answers": ["while (true) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            count++;\n            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_18_2", "question": "            System.out.println(count);\n        }\n         int count = 0;\n        while (true) {\n  ", "target": "          count++;\n", "answers": ["          count++;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            System.out.println(count);\n        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            System.out.println(count);\n        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            System.out.println(count);\n        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_19_0", "question": "        }\n    }\n         while (true) {\n            count++;\n", "target": "            System.out.println(count);\n", "answers": ["            System.out.println(count);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server org junit Test Test01 Test test01 count count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_20_0", "question": "    }\n}\n             count++;\n            System.out.println(count);\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server org junit Test Test01 Test test01 count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_21_0", "question": "}\n             System.out.println(count);\n        }\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server org junit Test Test01 Test test01 count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/Test01.java_22_0", "question": "         }\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server org junit Test Test01 Test test01 count count System out println count", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[Test01]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[Test01]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test01", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[Test01]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[Test01]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[Test01]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\n\n/**\n * Created by Ding on 2019/4/12 8:01 PM.\n *\n * @Description: readme\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\npublic class Test01 {\n\n\n    @Test\n    public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_0_11", "question": "\nimport org.junit.Test;\n package me.", "target": "codegc.apet.server;\n", "answers": ["codegc.apet.server;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_2_0", "question": "import org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\n package me.codegc.apet.server;\n\n", "target": "import org.junit.Test;\n", "answers": ["import org.junit.Test;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_3_7", "question": "import org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n \nimport org.junit.Test;\nimport ", "target": "org.junit.runner.RunWith;\n", "answers": ["org.junit.runner.RunWith;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_4_27", "question": "import org.springframework.test.context.junit4.SpringRunner;\n\n import org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.", "target": "boot.test.context.SpringBootTest;\n", "answers": ["boot.test.context.SpringBootTest;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_5_11", "question": "\n@RunWith(SpringRunner.class)\n import org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.", "target": "springframework.test.context.junit4.SpringRunner;\n", "answers": ["springframework.test.context.junit4.SpringRunner;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_7_9", "question": "@SpringBootTest\npublic class ApetApplicationTests {\n import org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(", "target": "SpringRunner.class)\n", "answers": ["SpringRunner.class)\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "SpringBootTest ApetApplicationTests Test contextLoads", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_8_0", "question": "public class ApetApplicationTests {\n\n \n@RunWith(SpringRunner.class)\n", "target": "@SpringBootTest\n", "answers": ["@SpringBootTest\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApetApplicationTests Test contextLoads", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_9_13", "question": "\n    @Test\n @RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ", "target": "ApetApplicationTests {\n", "answers": ["ApetApplicationTests {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Test\n    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test contextLoads", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_11_2", "question": "    public void contextLoads() {\n    }\n public class ApetApplicationTests {\n\n  ", "target": "  @Test\n", "answers": ["  @Test\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void contextLoads() {\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void contextLoads() {\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void contextLoads() {\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "contextLoads", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n[ApetApplicationTests]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n[ApetApplicationTests]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n[ApetApplicationTests]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n[ApetApplicationTests]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n[ApetApplicationTests]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n[ApetApplicationTests]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n[ApetApplicationTests]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n[ApetApplicationTests]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n[ApetApplicationTests]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_12_4", "question": "    }\n\n \n    @Test\n    ", "target": "public void contextLoads() {\n", "answers": ["public void contextLoads() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n[ApetApplicationTests]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n[ApetApplicationTests]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n[ApetApplicationTests]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n[ApetApplicationTests]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n[ApetApplicationTests]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n[ApetApplicationTests]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n[ApetApplicationTests]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n[ApetApplicationTests]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n[ApetApplicationTests]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_13_0", "question": "\n}\n     @Test\n    public void contextLoads() {\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n[ApetApplicationTests]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n[ApetApplicationTests]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n[ApetApplicationTests]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n[ApetApplicationTests]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n[ApetApplicationTests]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n[ApetApplicationTests]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n[ApetApplicationTests]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n[ApetApplicationTests]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n[ApetApplicationTests]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/ApetApplicationTests.java_15_0", "question": "     }\n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[Test01] [test01]     public void test01() {\n        int count = 0;\n        while (true) {\n            count++;\n            System.out.println(count);\n        }\n    } \n[ApetApplicationTests]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[Test01] me codegc apet server org junit Test Test01 Test test01 count count System out println count \n[ApetApplicationTests]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "SpringRunner", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "contextLoads", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[Test01]  \n[ApetApplicationTests]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplication] me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication \n[ApetApplicationTests]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplication] [main]     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    } \n[ApetApplicationTests]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[Test01] test01 \n[ApetApplicationTests]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class ApetApplicationTests {\n\n    @Test\n    public void contextLoads() {\n    }\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplication]  \n[ApetApplicationTests]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplication] main \n[ApetApplicationTests]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplication] String  ApetApplication \n[ApetApplicationTests]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplication] \"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date() \n[ApetApplicationTests]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_0_0", "question": "\nimport org.junit.Test;\n ", "target": "package me.codegc.apet.server.model;\n", "answers": ["package me.codegc.apet.server.model;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"mess\" \"ok\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_2_7", "question": "\n\n package me.codegc.apet.server.model;\n\nimport ", "target": "org.junit.Test;\n", "answers": ["org.junit.Test;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"mess\" \"ok\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_7_13", "question": "\n\n \n\npublic class ", "target": "JsonResultTest {\n", "answers": ["JsonResultTest {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test test System out println init JsonResult SUCCESS builder toString JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"mess\" \"ok\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport org.junit.Test;\n\n\n\n\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_10_4", "question": "    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n \n\n    ", "target": "@Test\n", "answers": ["@Test\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "test System out println init JsonResult SUCCESS builder toString JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"mess\" \"ok\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[JsonResultTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[JsonResultTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n[JsonResultTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[JsonResultTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_11_17", "question": "        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n \n    @Test\n    public  void ", "target": "test(){\n", "answers": ["test(){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "System out println init JsonResult SUCCESS builder toString JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"mess\" \"ok\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[JsonResultTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[JsonResultTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n[JsonResultTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[JsonResultTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_12_69", "question": "    }\n}     @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).", "target": "builder(\"mess\", \"ok\").toString());\n", "answers": ["builder(\"mess\", \"ok\").toString());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[JsonResultTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[JsonResultTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n[JsonResultTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[JsonResultTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_13_0", "question": "}     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"mess\" \"ok\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[JsonResultTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[JsonResultTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n[JsonResultTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[JsonResultTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/model/JsonResultTest.java_14_0", "question": "         System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n", "target": "}", "answers": ["}"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"mess\" \"ok\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[JsonResultTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport org.junit.Test;\n\n\n\n\npublic class JsonResultTest {\n\n\n    @Test\n    public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[JsonResultTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [JsonResult] init toString builder \n[JsonResultTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[JsonResultTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[JsonResultTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_0_11", "question": "\nimport org.junit.Test;\n package me.", "target": "codegc.apet.server.services;\n", "answers": ["codegc.apet.server.services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n", "score": 0.0625}, {"title": "codex", "text": "package me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_2_17", "question": "\npublic class JingSanOpenServiceTest {\n package me.codegc.apet.server.services;\n\nimport org.junit.", "target": "Test;\n", "answers": ["Test;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_4_0", "question": "\n    @Test\n import org.junit.Test;\n\n", "target": "public class JingSanOpenServiceTest {\n", "answers": ["public class JingSanOpenServiceTest {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_6_0", "question": "    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n public class JingSanOpenServiceTest {\n\n", "target": "    @Test\n", "answers": ["    @Test\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[JingSanOpenServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n[JingSanOpenServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[JingSanOpenServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[JingSanOpenServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n[JingSanOpenServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[JingSanOpenServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[JingSanOpenServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[JingSanOpenServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JingSanOpenServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JingSanOpenServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JingSanOpenServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JingSanOpenServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_7_2", "question": "        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n \n    @Test\n  ", "target": "  public void jingSanOpenAPI() {\n", "answers": ["  public void jingSanOpenAPI() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "js System out println js JinShanOpenAPI JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[JingSanOpenServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n[JingSanOpenServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[JingSanOpenServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[JingSanOpenServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n[JingSanOpenServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[JingSanOpenServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[JingSanOpenServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[JingSanOpenServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JingSanOpenServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JingSanOpenServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JingSanOpenServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JingSanOpenServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_8_22", "question": "        System.out.println(js.JinShanOpenAPI());\n    }\n     @Test\n    public void jingSanOpenAPI() {\n        JSOpenService ", "target": "js = new JSOpenService();\n", "answers": ["js = new JSOpenService();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        System.out.println(js.JinShanOpenAPI());\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "System out println js JinShanOpenAPI", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[JingSanOpenServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n[JingSanOpenServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[JingSanOpenServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[JingSanOpenServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n[JingSanOpenServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[JingSanOpenServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[JingSanOpenServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[JingSanOpenServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JingSanOpenServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JingSanOpenServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JingSanOpenServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JingSanOpenServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_9_15", "question": "    }\n}     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.", "target": "out.println(js.JinShanOpenAPI());\n", "answers": ["out.println(js.JinShanOpenAPI());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[JingSanOpenServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n[JingSanOpenServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[JingSanOpenServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[JingSanOpenServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n[JingSanOpenServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[JingSanOpenServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[JingSanOpenServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[JingSanOpenServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JingSanOpenServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JingSanOpenServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JingSanOpenServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JingSanOpenServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_10_0", "question": "}         JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[JingSanOpenServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n[JingSanOpenServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[JingSanOpenServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[JingSanOpenServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n[JingSanOpenServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[JingSanOpenServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[JingSanOpenServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[JingSanOpenServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JingSanOpenServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JingSanOpenServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JingSanOpenServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JingSanOpenServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/JingSanOpenServiceTest.java_11_0", "question": "         System.out.println(js.JinShanOpenAPI());\n    }\n", "target": "}", "answers": ["}"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[JingSanOpenServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JSOpenService", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "jingSanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest]  \n[JingSanOpenServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[JingSanOpenServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[JingSanOpenServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[JingSanOpenServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioServiceTest] paly [TranslationServiceTest] toEN tts \n[JingSanOpenServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\npublic class JingSanOpenServiceTest {\n\n    @Test\n    public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[JingSanOpenServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[JingSanOpenServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[JingSanOpenServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[JingSanOpenServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JingSanOpenServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JingSanOpenServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JingSanOpenServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JingSanOpenServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JingSanOpenServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_0_23", "question": "\nimport com.alibaba.fastjson.JSONObject;\n package me.codegc.apet.", "target": "server.services;\n", "answers": ["server.services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_2_11", "question": "import me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n package me.codegc.apet.server.services;\n\nimport com.", "target": "alibaba.fastjson.JSONObject;\n", "answers": ["alibaba.fastjson.JSONObject;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_3_22", "question": "import org.junit.Test;\n\n \nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.", "target": "server.utils.HttpClient;\n", "answers": ["server.utils.HttpClient;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_4_7", "question": "\nimport java.util.HashMap;\n import com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport ", "target": "org.junit.Test;\n", "answers": ["org.junit.Test;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_6_17", "question": "import java.util.Map;\n\n import org.junit.Test;\n\nimport java.util.", "target": "HashMap;\n", "answers": ["HashMap;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_7_20", "question": "\npublic class TranslationServiceTest {\n \nimport java.util.HashMap;\nimport java.util.Map", "target": ";\n", "answers": [";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_9_13", "question": "\n    @Test\n import java.util.Map;\n\npublic class ", "target": "TranslationServiceTest {\n", "answers": ["TranslationServiceTest {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_11_4", "question": "    public void toEN() {\n        Map<String,Object> param = new HashMap();\n public class TranslationServiceTest {\n\n    ", "target": "@Test\n", "answers": ["@Test\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_12_16", "question": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n \n    @Test\n    public void ", "target": "toEN() {\n", "answers": ["toEN() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_13_6", "question": "        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n     @Test\n    public void toEN() {\n      ", "target": "  Map<String,Object> param = new HashMap();\n", "answers": ["  Map<String,Object> param = new HashMap();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n      ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_14_14", "question": "        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.", "target": "put(\"from\",\"zh\");\n", "answers": ["put(\"from\",\"zh\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_15_0", "question": "        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n         Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n", "target": "        param.put(\"to\",\"en\");\n", "answers": ["        param.put(\"to\",\"en\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_16_19", "question": "        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n         param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"", "target": "query\",\"\u60a8\u597d\");\n", "answers": ["query\",\"\u60a8\u597d\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_17_23", "question": "        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n         param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new ", "target": "HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n", "answers": ["HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_18_18", "question": "        String s1 = JSONObject.toJSONString(s);\n\n         param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = ", "target": "JSONObject.parseObject(s, Map.class);\n", "answers": ["JSONObject.parseObject(s, Map.class);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_19_3", "question": "\n        System.out.println(s1);\n         String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n   ", "target": "     String s1 = JSONObject.toJSONString(s);\n", "answers": ["     String s1 = JSONObject.toJSONString(s);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "System out println s1 Test tts bytes init get getBytes HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_21_19", "question": "    }\n\n         String s1 = JSONObject.toJSONString(s);\n\n        System.out.", "target": "println(s1);\n", "answers": ["println(s1);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test tts bytes init get getBytes HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_22_0", "question": "\n\n \n        System.out.println(s1);\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test tts bytes init get getBytes HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_25_4", "question": "    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n \n\n    ", "target": "@Test\n", "answers": ["@Test\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "tts bytes init get getBytes HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_26_4", "question": "        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n \n    @Test\n    ", "target": "public void tts(){\n", "answers": ["public void tts(){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "bytes init get getBytes HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_27_40", "question": "\n    }\n     @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().", "target": "init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n", "answers": ["init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_29_0", "question": "}         byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/TranslationServiceTest.java_30_0", "question": " \n    }\n", "target": "}", "answers": ["}"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } \n[TranslationServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException \n[TranslationServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap String HttpClient Map Map String HttpClient", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toEN tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException \n[TranslationServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  \n[TranslationServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[TranslationServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly \n[TranslationServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.junit.Test;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic class TranslationServiceTest {\n\n    @Test\n    public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    }\n\n\n    @Test\n    public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[TranslationServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationAPI] test transapi [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[TranslationServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[TranslationServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[TranslationServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[TranslationServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[TranslationServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[TranslationServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_0_30", "question": "\nimport org.junit.Test;\n package me.codegc.apet.server.", "target": "services;\n", "answers": ["services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org junit Test java io IOException AudioServiceTest Test paly IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_2_11", "question": "\nimport java.io.IOException;\n package me.codegc.apet.server.services;\n\nimport org.", "target": "junit.Test;\n", "answers": ["junit.Test;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io IOException AudioServiceTest Test paly IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_4_15", "question": "\npublic class AudioServiceTest {\n import org.junit.Test;\n\nimport java.io.", "target": "IOException;\n", "answers": ["IOException;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "AudioServiceTest Test paly IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_6_13", "question": "\n    @Test\n import java.io.IOException;\n\npublic class ", "target": "AudioServiceTest {\n", "answers": ["AudioServiceTest {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Test paly IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_8_4", "question": "    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n public class AudioServiceTest {\n\n    ", "target": "@Test\n", "answers": ["@Test\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "paly IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[AudioServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n[AudioServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[AudioServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n[AudioServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[AudioServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_9_30", "question": "//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n \n    @Test\n    public void paly() throws ", "target": "IOException {\n", "answers": ["IOException {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[AudioServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n[AudioServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[AudioServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n[AudioServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[AudioServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_18_0", "question": "} //        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[AudioServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n[AudioServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[AudioServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n[AudioServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[AudioServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/test/java/me/codegc/apet/server/services/AudioServiceTest.java_19_0", "question": " //        audioService.paly(pram,null);\n    }\n", "target": "}", "answers": ["}"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } \n[AudioServiceTest]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest]  \n[AudioServiceTest]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient \n[AudioServiceTest]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" \n[AudioServiceTest]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult [JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } [JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioServiceTest]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts \n[AudioServiceTest]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.junit.Test;\n\nimport java.io.IOException;\n\npublic class AudioServiceTest {\n\n    @Test\n    public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  [JingSanOpenServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioServiceTest]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test [JingSanOpenServiceTest] jingSanOpenAPI [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[AudioServiceTest]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult [JingSanOpenServiceTest] JSOpenService JSOpenService [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioServiceTest]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" [JingSanOpenServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioServiceTest]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioServiceTest]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioServiceTest]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioServiceTest]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioServiceTest]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioServiceTest]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_0_18", "question": "\nimport lombok.extern.slf4j.Slf4j;\n package me.codegc.", "target": "apet.server;\n", "answers": ["apet.server;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_2_0", "question": "import org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n package me.codegc.apet.server;\n\n", "target": "import lombok.extern.slf4j.Slf4j;\n", "answers": ["import lombok.extern.slf4j.Slf4j;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_3_32", "question": "import org.springframework.boot.autoconfigure.SpringBootApplication;\n\n \nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.", "target": "SpringApplication;\n", "answers": ["SpringApplication;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_4_0", "question": "\nimport java.util.Date;\n import lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\n", "target": "import org.springframework.boot.autoconfigure.SpringBootApplication;\n", "answers": ["import org.springframework.boot.autoconfigure.SpringBootApplication;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_6_7", "question": "\n@Slf4j\n import org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport ", "target": "java.util.Date;\n", "answers": ["java.util.Date;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_8_0", "question": "@SpringBootApplication\npublic class ApetApplication {\n import java.util.Date;\n\n", "target": "@Slf4j\n", "answers": ["@Slf4j\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_9_0", "question": "public class ApetApplication {\n\n \n@Slf4j\n", "target": "@SpringBootApplication\n", "answers": ["@SpringBootApplication\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_10_13", "question": "\n\n @Slf4j\n@SpringBootApplication\npublic class ", "target": "ApetApplication {\n", "answers": ["ApetApplication {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_13_36", "question": "        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n \n\n    public static void main(String[]", "target": " args) {\n", "answers": [" args) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "log info SpringApplication run args  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": " ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[ApetApplication]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[ApetApplication]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[]", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[ApetApplication]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[ApetApplication]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_14_35", "question": "        SpringApplication.run(ApetApplication.class, args);\n    }\n \n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", ", "target": "new Date());\n", "answers": ["new Date());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "SpringApplication run args ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[ApetApplication]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[ApetApplication]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[ApetApplication]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[ApetApplication]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_15_30", "question": "    }\n\n     public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(", "target": "ApetApplication.class, args);\n", "answers": ["ApetApplication.class, args);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run String ", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String ", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[ApetApplication]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[ApetApplication]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[ApetApplication]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[ApetApplication]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_16_0", "question": "\n\n         log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[ApetApplication]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[ApetApplication]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[ApetApplication]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[ApetApplication]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/ApetApplication.java_19_0", "question": " \n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server lombok extern slf4j Slf4j org springframework boot SpringApplication org springframework boot autoconfigure SpringBootApplication java util Date Slf4j SpringBootApplication ApetApplication main args log info SpringApplication run args String  ApetApplication", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String  ApetApplication", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "main", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date()", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[ApetApplicationTests] me codegc apet server org junit Test org junit runner RunWith org springframework boot test context SpringBootTest org springframework test context junit4 SpringRunner RunWith SpringBootTest ApetApplicationTests Test contextLoads SpringRunner \n[ApetApplication]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[ApetApplicationTests] [contextLoads]     public void contextLoads() {\n    } \n[ApetApplication]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\nimport java.util.Date;\n\n@Slf4j\n@SpringBootApplication\npublic class ApetApplication {\n\n\n    public static void main(String[] args) {\n        log.info(\"{} >>>> \u7a0b\u5e8f\u6b63\u5728\u542f\u52a8\", new Date());\n        SpringApplication.run(ApetApplication.class, args);\n    }\n\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[ApetApplicationTests] contextLoads \n[ApetApplication]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[ApetApplicationTests] SpringRunner \n[ApetApplication]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[ApetApplicationTests]  \n[ApetApplication]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_0_11", "question": "\nimport io.swagger.annotations.Api;\n package me.", "target": "codegc.apet.server.controller;\n", "answers": ["codegc.apet.server.controller;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_2_10", "question": "import io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\n package me.codegc.apet.server.controller;\n\nimport io.", "target": "swagger.annotations.Api;\n", "answers": ["swagger.annotations.Api;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_3_10", "question": "import io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\n \nimport io.swagger.annotations.Api;\nimport io.", "target": "swagger.annotations.ApiOperation;\n", "answers": ["swagger.annotations.ApiOperation;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_4_18", "question": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\n import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.", "target": "annotations.ApiParam;\n", "answers": ["annotations.ApiParam;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_5_17", "question": "import me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\n import io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.", "target": "apet.server.model.JsonResult;\n", "answers": ["apet.server.model.JsonResult;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_6_22", "question": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\n import io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.", "target": "server.services.OCRService;\n", "answers": ["server.services.OCRService;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_7_11", "question": "import org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.", "target": "springframework.beans.factory.annotation.Autowired;\n", "answers": ["springframework.beans.factory.annotation.Autowired;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_8_27", "question": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\n import me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.", "target": "web.bind.annotation.PostMapping;\n", "answers": ["web.bind.annotation.PostMapping;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_9_0", "question": "import org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\n", "target": "import org.springframework.web.bind.annotation.RequestMapping;\n", "answers": ["import org.springframework.web.bind.annotation.RequestMapping;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_10_27", "question": "import org.springframework.web.multipart.MultipartFile;\n\n import org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.", "target": "web.bind.annotation.RestController;\n", "answers": ["web.bind.annotation.RestController;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_11_7", "question": "\nimport java.io.File;\n import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport ", "target": "org.springframework.web.multipart.MultipartFile;\n", "answers": ["org.springframework.web.multipart.MultipartFile;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_13_15", "question": "import java.io.IOException;\n\n import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.", "target": "File;\n", "answers": ["File;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_14_0", "question": "\n/**\n \nimport java.io.File;\n", "target": "import java.io.IOException;\n", "answers": ["import java.io.IOException;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_23_13", "question": "@RestController\n@RequestMapping(\"/ocr\")\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"", "target": "OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n", "answers": ["OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_24_0", "question": "@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n  */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n", "target": "@RestController\n", "answers": ["@RestController\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_25_0", "question": "public class OCRAPI {\n\n @Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n", "target": "@RequestMapping(\"/ocr\")\n", "answers": ["@RequestMapping(\"/ocr\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_26_13", "question": "\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n @RestController\n@RequestMapping(\"/ocr\")\npublic class ", "target": "OCRAPI {\n", "answers": ["OCRAPI {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_29_37", "question": "\n    @Autowired\n \n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"", "target": "/Users/jdode/Pictures\";\n", "answers": ["/Users/jdode/Pictures\";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_31_4", "question": "    OCRService ocrService;\n\n     private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    ", "target": "@Autowired\n", "answers": ["@Autowired\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_32_4", "question": "\n\n \n    @Autowired\n    ", "target": "OCRService ocrService;\n", "answers": ["OCRService ocrService;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_35_49", "question": "    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"", "target": "OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n", "answers": ["OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_36_33", "question": "    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n \n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", ", "target": "headers = \"content-type=multipart/form-data\")\n", "answers": ["headers = \"content-type=multipart/form-data\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_37_11", "question": "                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n     @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public ", "target": "JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n", "answers": ["JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_38_7", "question": "        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n     @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n       ", "target": "                           MultipartFile file) {\n", "answers": ["                           MultipartFile file) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n       ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_39_17", "question": "            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.", "target": "isEmpty() || file == null) {\n", "answers": ["isEmpty() || file == null) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_40_23", "question": "        }\n\n                                   MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new ", "target": "JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n", "answers": ["JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [OCRService] OCR \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [OCRService] String JTesseract JTesseract Tesseract String String File \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_41_0", "question": "\n        String fileName = file.getOriginalFilename();\n         if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_43_26", "question": "        File dest = new File(FILEPATH + fileName);\n        try {\n         }\n\n        String fileName = ", "target": "file.getOriginalFilename();\n", "answers": ["file.getOriginalFilename();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_44_7", "question": "        try {\n            file.transferTo(dest);\n \n        String fileName = file.getOriginalFilename();\n       ", "target": " File dest = new File(FILEPATH + fileName);\n", "answers": [" File dest = new File(FILEPATH + fileName);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n       ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_45_0", "question": "            file.transferTo(dest);\n        } catch (IOException e) {\n         String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n", "target": "        try {\n", "answers": ["        try {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_46_17", "question": "        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n         File dest = new File(FILEPATH + fileName);\n        try {\n            file.", "target": "transferTo(dest);\n", "answers": ["transferTo(dest);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_47_8", "question": "            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n         try {\n            file.transferTo(dest);\n        ", "target": "} catch (IOException e) {\n", "answers": ["} catch (IOException e) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_48_12", "question": "        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n             file.transferTo(dest);\n        } catch (IOException e) {\n            ", "target": "return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n", "answers": ["return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_49_0", "question": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n                .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n         } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult SUCCESS builder builder ocrService OCR dest getPath JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_50_37", "question": "                .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n             return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(", "target": "JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n", "answers": ["JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "builder ocrService OCR dest getPath", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_51_2", "question": "    }\n}\n         }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n  ", "target": "              .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n", "answers": ["              .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_52_0", "question": "}\n         return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n                .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/OCRAPI.java_53_0", "question": "                 .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[OCRAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport io.swagger.annotations.ApiParam;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.OCRService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:04 PM.\n *\n * @Description: OCR\u8c03\u7528\u63a5\u53e3\n * <p>\u00d8\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\")\n@RestController\n@RequestMapping(\"/ocr\")\npublic class OCRAPI {\n\n    //\u6587\u4ef6\u5b58\u50a8\u8def\u5f84\n    private final String FILEPATH = \"/Users/jdode/Pictures\";\n\n    @Autowired\n    OCRService ocrService;\n\n\n    @ApiOperation(value = \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes = \"OCR\u76ee\u524d\u4ec5\u652f\u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\")\n    @PostMapping(value = \"/api\", headers = \"content-type=multipart/form-data\")\n    public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n                                  MultipartFile file) {\n        if (file.isEmpty() || file == null) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\");\n        }\n\n        String fileName = file.getOriginalFilename();\n        File dest = new File(FILEPATH + fileName);\n        try {\n            file.transferTo(dest);\n        } catch (IOException e) {\n            return new JsonResult().init(JsonResult.ERROR).builder(\"error\", \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\");\n        }\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"message\", \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\")\n               .builder(\"OCR\", ocrService.OCR(dest.getPath()));\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; \n[OCRAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api \n[OCRAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult \n[OCRAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[OCRAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[OCRAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder \n[OCRAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[OCRAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[OCRAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[OCRAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[OCRAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_0_23", "question": "\nimport io.swagger.annotations.Api;\n package me.codegc.apet.", "target": "server.controller;\n", "answers": ["server.controller;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_2_0", "question": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\n package me.codegc.apet.server.controller;\n\n", "target": "import io.swagger.annotations.Api;\n", "answers": ["import io.swagger.annotations.Api;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_3_30", "question": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\n \nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.", "target": "ApiOperation;\n", "answers": ["ApiOperation;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_4_35", "question": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.", "target": "JsonResult;\n", "answers": ["JsonResult;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_5_36", "question": "import org.springframework.web.bind.annotation.RestController;\n\n import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.", "target": "annotation.GetMapping;\n", "answers": ["annotation.GetMapping;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_6_36", "question": "\n/**\n import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.", "target": "annotation.RestController;\n", "answers": ["annotation.RestController;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_15_13", "question": "@RestController\npublic class UpdateAPI {\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"", "target": "Client\u68c0\u67e5\u66f4\u65b0API\")\n", "answers": ["Client\u68c0\u67e5\u66f4\u65b0API\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_16_0", "question": "public class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n  */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n", "target": "@RestController\n", "answers": ["@RestController\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_17_7", "question": "    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n @Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic ", "target": "class UpdateAPI {\n", "answers": ["class UpdateAPI {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_18_4", "question": "    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n @RestController\npublic class UpdateAPI {\n    ", "target": "@ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n", "answers": ["@ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[UpdateAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_19_17", "question": "    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n public class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"", "target": "/checkUpdate\")\n", "answers": ["/checkUpdate\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[UpdateAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_20_11", "question": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n     @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public ", "target": "JsonResult checkUpdate(){\n", "answers": ["JsonResult checkUpdate(){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult SUCCESS builder JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[UpdateAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_21_5", "question": "    }\n}\n     @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n     ", "target": "   return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n", "answers": ["   return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n     ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[UpdateAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_22_0", "question": "}\n     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[UpdateAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/UpdateAPI.java_23_0", "question": "         return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "checkUpdate", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[UpdateAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * Created by Ding on 2019/3/31 8:26 PM.\n *\n * @Description: client\u68c0\u67e5\u66f4\u65b0\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"Client\u68c0\u67e5\u66f4\u65b0API\")\n@RestController\npublic class UpdateAPI {\n    @ApiOperation(\"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\")\n    @GetMapping(\"/checkUpdate\")\n    public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[UpdateAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[AudioAPI] audio_tts [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[UpdateAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[UpdateAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[UpdateAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[UpdateAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[UpdateAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[UpdateAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[UpdateAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[UpdateAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[UpdateAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_0_11", "question": "\nimport com.alibaba.fastjson.JSONObject;\n package me.", "target": "codegc.apet.server.controller;\n", "answers": ["codegc.apet.server.controller;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_2_7", "question": "import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\n package me.codegc.apet.server.controller;\n\nimport ", "target": "com.alibaba.fastjson.JSONObject;\n", "answers": ["com.alibaba.fastjson.JSONObject;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_3_18", "question": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\n \nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.", "target": "annotations.Api;\n", "answers": ["annotations.Api;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_4_30", "question": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\n import com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.", "target": "ApiImplicitParam;\n", "answers": ["ApiImplicitParam;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audio", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_5_18", "question": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\n import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.", "target": "annotations.ApiImplicitParams;\n", "answers": ["annotations.ApiImplicitParams;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_6_0", "question": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\n import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\n", "target": "import io.swagger.annotations.ApiOperation;\n", "answers": ["import io.swagger.annotations.ApiOperation;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_7_35", "question": "import me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\n import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.", "target": "JsonResult;\n", "answers": ["JsonResult;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_8_10", "question": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\n import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.", "target": "codegc.apet.server.services.AudioService;\n", "answers": ["codegc.apet.server.services.AudioService;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_9_41", "question": "import org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\n import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.", "target": "annotation.Autowired;\n", "answers": ["annotation.Autowired;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_10_27", "question": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n import me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.", "target": "stereotype.Controller;\n", "answers": ["stereotype.Controller;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_11_11", "question": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.", "target": "springframework.web.bind.annotation.GetMapping;\n", "answers": ["springframework.web.bind.annotation.GetMapping;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_12_11", "question": "import org.springframework.web.bind.annotation.RequestParam;\n\n import org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.", "target": "springframework.web.bind.annotation.RequestMapping;\n", "answers": ["springframework.web.bind.annotation.RequestMapping;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_13_0", "question": "\nimport javax.servlet.http.HttpServletResponse;\n import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n", "target": "import org.springframework.web.bind.annotation.RequestParam;\n", "answers": ["import org.springframework.web.bind.annotation.RequestParam;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_15_26", "question": "import java.io.IOException;\nimport java.util.HashMap;\n import org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.", "target": "HttpServletResponse;\n", "answers": ["HttpServletResponse;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_16_15", "question": "import java.util.HashMap;\nimport java.util.Map;\n \nimport javax.servlet.http.HttpServletResponse;\nimport java.io.", "target": "IOException;\n", "answers": ["IOException;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_17_17", "question": "import java.util.Map;\n\n import javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.", "target": "HashMap;\n", "answers": ["HashMap;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_18_7", "question": "\n/**\n import java.io.IOException;\nimport java.util.HashMap;\nimport ", "target": "java.util.Map;\n", "answers": ["java.util.Map;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_27_13", "question": "@Controller\n@RequestMapping(\"/mp3\")\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"", "target": "\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n", "answers": ["\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_28_0", "question": "@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n  */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n", "target": "@Controller\n", "answers": ["@Controller\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_29_0", "question": "public class AudioAPI {\n\n @Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n", "target": "@RequestMapping(\"/mp3\")\n", "answers": ["@RequestMapping(\"/mp3\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_30_0", "question": "\n\n @Controller\n@RequestMapping(\"/mp3\")\n", "target": "public class AudioAPI {\n", "answers": ["public class AudioAPI {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_33_2", "question": "    AudioService audioService;\n\n \n\n  ", "target": "  @Autowired\n", "answers": ["  @Autowired\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_34_4", "question": "\n\n \n    @Autowired\n    ", "target": "AudioService audioService;\n", "answers": ["AudioService audioService;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_37_27", "question": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n \n\n    @ApiOperation(value = \"", "target": "\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n", "answers": ["\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_38_4", "question": "            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n \n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    ", "target": "@ApiImplicitParams({\n", "answers": ["@ApiImplicitParams({\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_39_2", "question": "            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n     @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n  ", "target": "          @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n", "answers": ["          @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_40_12", "question": "    })\n    @GetMapping(\"/audio\")\n     @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            ", "target": "@ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n", "answers": ["@ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_41_0", "question": "    @GetMapping(\"/audio\")\n    public void audio_tts(\n             @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n", "target": "    })\n", "answers": ["    })\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_42_17", "question": "    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true ,defaultValue = \"\") String languageCode,\n             @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"", "target": "/audio\")\n", "answers": ["/audio\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [AudioService] paly \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_43_11", "question": "            @RequestParam(value=\"languageCode\",required = true ,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n     })\n    @GetMapping(\"/audio\")\n    public ", "target": "void audio_tts(\n", "answers": ["void audio_tts(\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_44_90", "question": "            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n     @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true ,defaultValue = \"\") String ", "target": "languageCode,\n", "answers": ["languageCode,\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_45_12", "question": "            HttpServletResponse response) throws IOException {\n\n     public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true ,defaultValue = \"\") String languageCode,\n            ", "target": "@RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n", "answers": ["@RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_46_32", "question": "\n        if (languageCode.isEmpty() || text.isEmpty()) {\n             @RequestParam(value=\"languageCode\",required = true ,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse ", "target": "response) throws IOException {\n", "answers": ["response) throws IOException {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_48_4", "question": "            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n             HttpServletResponse response) throws IOException {\n\n    ", "target": "    if (languageCode.isEmpty() || text.isEmpty()) {\n", "answers": ["    if (languageCode.isEmpty() || text.isEmpty()) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_49_12", "question": "            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n \n        if (languageCode.isEmpty() || text.isEmpty()) {\n            ", "target": "response.setStatus(500);\n", "answers": ["response.setStatus(500);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_50_12", "question": "            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n         if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            ", "target": "response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n", "answers": ["response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_51_12", "question": "            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n             response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            ", "target": "response.setCharacterEncoding(\"utf-8\");\n", "answers": ["response.setCharacterEncoding(\"utf-8\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_52_119", "question": "            return;\n        }\n             response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"", "target": "\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n", "answers": ["\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_53_4", "question": "        }\n        \n             response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n    ", "target": "        return;\n", "answers": ["        return;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_54_0", "question": "        \n        Map<String,String> pram = new HashMap();\n             response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_56_27", "question": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n         }\n        \n        Map<String,String> ", "target": "pram = new HashMap();\n", "answers": ["pram = new HashMap();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_58_8", "question": "        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n         Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        ", "target": "pram.put(\"lan\",languageCode);\n", "answers": ["pram.put(\"lan\",languageCode);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "pram put text replaceAll pram put pram put audioService paly pram response", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_59_24", "question": "        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n         //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",", "target": "text.replaceAll(\" \",\"\"));\n", "answers": ["text.replaceAll(\" \",\"\"));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "pram put pram put audioService paly pram response", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_60_2", "question": "        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n         pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n  ", "target": "      pram.put(\"spd\",\"5\");\n", "answers": ["      pram.put(\"spd\",\"5\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "pram put audioService paly pram response", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_61_8", "question": "        audioService.paly(pram,response);\n    }\n         pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        ", "target": "pram.put(\"source\",\"web\");\n", "answers": ["pram.put(\"source\",\"web\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        audioService.paly(pram,response);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        audioService.paly(pram,response);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        audioService.paly(pram,response);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "audioService paly pram response", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_62_26", "question": "    }\n}\n         pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(", "target": "pram,response);\n", "answers": ["pram,response);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_63_0", "question": "}\n         pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/AudioAPI.java_64_0", "question": "         audioService.paly(pram,response);\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "audio_tts", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[AudioAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    AudioService audioService;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport com.alibaba.fastjson.JSONObject;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.AudioService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 4:08 PM.\n *\n * @Description: \u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Api(tags = \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\")\n@Controller\n@RequestMapping(\"/mp3\")\npublic class AudioAPI {\n\n\n    @Autowired\n    AudioService audioService;\n\n\n    @ApiOperation(value = \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94\u7684\u6587\u5b57\u5373\u53ef\u8f6c\u6362\u6210\u8bed\u97f3\u6587\u4ef6\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"languageCode\", value = \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"text\",value = \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    })\n    @GetMapping(\"/audio\")\n    public void audio_tts(\n            @RequestParam(value=\"languageCode\",required = true,defaultValue = \"\") String languageCode,\n            @RequestParam(value = \"text\",required = true,defaultValue = \"\") String text,\n            HttpServletResponse response) throws IOException {\n\n        if (languageCode.isEmpty() || text.isEmpty()) {\n            response.setStatus(500);\n            response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n            response.setCharacterEncoding(\"utf-8\");\n            response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\")));\n            return;\n        }\n        \n        Map<String,String> pram = new HashMap();\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        pram.put(\"lan\",languageCode);\n        pram.put(\"text\",text.replaceAll(\" \",\"\"));\n        pram.put(\"spd\",\"5\");\n        pram.put(\"source\",\"web\");\n        audioService.paly(pram,response);\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[AudioAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [TranslationAPI] test transapi [WelcomeAPI] welcome_api [OCRAPI] OCR \n[AudioAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[AudioAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[AudioAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[AudioAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder \n[AudioAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[AudioAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[AudioAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[AudioAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[AudioAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_0_30", "question": "\nimport io.swagger.annotations.Api;\n package me.codegc.apet.server.", "target": "controller;\n", "answers": ["controller;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_2_10", "question": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\n package me.codegc.apet.server.controller;\n\nimport io.", "target": "swagger.annotations.Api;\n", "answers": ["swagger.annotations.Api;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_3_7", "question": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\n \nimport io.swagger.annotations.Api;\nimport ", "target": "io.swagger.annotations.ApiImplicitParam;\n", "answers": ["io.swagger.annotations.ApiImplicitParam;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_4_30", "question": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\n import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.", "target": "ApiImplicitParams;\n", "answers": ["ApiImplicitParams;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_5_30", "question": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\n import io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.", "target": "ApiOperation;\n", "answers": ["ApiOperation;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_6_10", "question": "import me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\n import io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.", "target": "codegc.apet.server.model.JsonResult;\n", "answers": ["codegc.apet.server.model.JsonResult;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_7_29", "question": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n import io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.", "target": "services.TranslationService;\n", "answers": ["services.TranslationService;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_8_41", "question": "import org.springframework.web.bind.annotation.*;\n\n import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.", "target": "annotation.Autowired;\n", "answers": ["annotation.Autowired;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_9_7", "question": "\nimport javax.servlet.http.HttpServletRequest;\n import me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport ", "target": "org.springframework.web.bind.annotation.*;\n", "answers": ["org.springframework.web.bind.annotation.*;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_11_13", "question": "import javax.servlet.http.HttpServletResponse;\n\n import org.springframework.web.bind.annotation.*;\n\nimport javax.", "target": "servlet.http.HttpServletRequest;\n", "answers": ["servlet.http.HttpServletRequest;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_12_0", "question": "\n\n \nimport javax.servlet.http.HttpServletRequest;\n", "target": "import javax.servlet.http.HttpServletResponse;\n", "answers": ["import javax.servlet.http.HttpServletResponse;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_24_19", "question": "@RestController\n@RequestMapping(\"/transapi\")\n  * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API ", "target": "v1.2\")\n", "answers": ["v1.2\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_25_0", "question": "@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n  */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n", "target": "@RestController\n", "answers": ["@RestController\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_26_17", "question": "public class TranslationAPI {\n\n @Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"", "target": "/transapi\")\n", "answers": ["/transapi\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_27_13", "question": "\n    @Autowired\n @RestController\n@RequestMapping(\"/transapi\")\npublic class ", "target": "TranslationAPI {\n", "answers": ["TranslationAPI {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_29_2", "question": "    HttpServletRequest request;\n\n public class TranslationAPI {\n\n  ", "target": "  @Autowired\n", "answers": ["  @Autowired\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_30_23", "question": "\n    @Autowired\n \n    @Autowired\n    HttpServletRequest ", "target": "request;\n", "answers": ["request;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_32_4", "question": "    HttpServletResponse response;\n\n     HttpServletRequest request;\n\n    ", "target": "@Autowired\n", "answers": ["@Autowired\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_33_4", "question": "\n\n \n    @Autowired\n    ", "target": "HttpServletResponse response;\n", "answers": ["HttpServletResponse response;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_37_4", "question": "    private TranslationService t;\n\n \n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    ", "target": "@Autowired\n", "answers": ["@Autowired\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_38_4", "question": "\n    @GetMapping(\"/test\")\n     //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    ", "target": "private TranslationService t;\n", "answers": ["private TranslationService t;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_40_17", "question": "    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n     private TranslationService t;\n\n    @GetMapping(\"", "target": "/test\")\n", "answers": ["/test\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_41_4", "question": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n \n    @GetMapping(\"/test\")\n    ", "target": "public JsonResult test() {\n", "answers": ["public JsonResult test() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_42_48", "question": "    }\n\n     @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.", "target": "SUCCESS).builder(\"ok\", System.currentTimeMillis());\n", "answers": ["SUCCESS).builder(\"ok\", System.currentTimeMillis());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_43_0", "question": "\n\n     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_46_53", "question": "    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n \n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"", "target": "\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n", "answers": ["\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_47_4", "question": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n \n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    ", "target": "@GetMapping(\"/from\")\n", "answers": ["@GetMapping(\"/from\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_48_4", "question": "            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n            ,\n     @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    ", "target": "@ApiImplicitParams({\n", "answers": ["@ApiImplicitParams({\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [TranslationService] trans \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_49_83", "question": "            ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n     @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required ", "target": "= true, dataType = \"String\", paramType = \"query\")\n", "answers": ["= true, dataType = \"String\", paramType = \"query\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_50_0", "question": "            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n            ,\n     @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n", "target": "            ,\n", "answers": ["            ,\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_51_38", "question": "            ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n             @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n            ,\n            @ApiImplicitParam(name = \"", "target": "toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n", "answers": ["toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_52_0", "question": "            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n             ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n", "target": "            ,\n", "answers": ["            ,\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_53_35", "question": "    }\n    )\n             @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n            ,\n            @ApiImplicitParam(name ", "target": "= \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n", "answers": ["= \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_54_0", "question": "    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n             ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_55_0", "question": "    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query != null && Country != null && toCountry != null) {\n             @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n", "target": "    )\n", "answers": ["    )\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_56_61", "question": "        if (Query != null && Country != null && toCountry != null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n     }\n    )\n    public JsonResult transapi(@RequestParam String Country, ", "target": "@RequestParam String toCountry, @RequestParam String Query) {\n", "answers": ["@RequestParam String toCountry, @RequestParam String Query) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_57_40", "question": "            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n     )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query != null && Country != ", "target": "null && toCountry != null) {\n", "answers": ["null && toCountry != null) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_58_89", "question": "        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n     public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query != null && Country != null && toCountry != null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, ", "target": "Country, toCountry));\n", "answers": ["Country, toCountry));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult ERROR builder JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_59_0", "question": "        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n         if (Query != null && Country != null && toCountry != null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult ERROR builder JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_60_30", "question": "    }\n\n             return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult(", "target": ").init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n", "answers": [").init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_61_0", "question": "\n\n         }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/TranslationAPI.java_66_0", "question": " \n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "test transapi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[TranslationAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiImplicitParam;\nimport io.swagger.annotations.ApiImplicitParams;\nimport io.swagger.annotations.ApiOperation;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.TranslationService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.*;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\n/**\n * @author: Ding / 2019-03-23 12:34\n * @version: V1.0\n * @TODO: \u63d0\u4f9bclient\u4f7f\u7528\u7684API\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Api(tags = \"\u7ffb\u8bd1API v1.2\")\n@RestController\n@RequestMapping(\"/transapi\")\npublic class TranslationAPI {\n\n    @Autowired\n    HttpServletRequest request;\n\n    @Autowired\n    HttpServletResponse response;\n\n\n    //http://localhost:8080/transapi/from?Country=zh&toCountry=kor&Query=\u60a8\u597d\n    @Autowired\n    private TranslationService t;\n\n    @GetMapping(\"/test\")\n    public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    }\n\n\n    @ApiOperation(value = \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20\u5165\u5bf9\u5e94\u56fd\u5bb6\u4ee3\u7801\u5373\u53ef\u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\")\n    @GetMapping(\"/from\")\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"Country\", value = \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"toCountry\", value = \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"String\", paramType = \"query\")\n           ,\n            @ApiImplicitParam(name = \"Query\",value = \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType = \"String\",paramType = \"query\")\n    }\n    )\n    public JsonResult transapi(@RequestParam String Country, @RequestParam String toCountry, @RequestParam String Query) {\n        if (Query!= null && Country!= null && toCountry!= null) {\n            return new JsonResult().init(JsonResult.SUCCESS).builder(\"t\", t.trans(Query, Country, toCountry));\n        }\n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    }\n\n\n\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [WelcomeAPI] @Autowired\n    JSOpenService js; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[TranslationAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [WelcomeAPI] welcome_api [OCRAPI] OCR \n[TranslationAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [WelcomeAPI] JSOpenService JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[TranslationAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[TranslationAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [HttpClient] private String url; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [HttpClient] init get get get get post post [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [HttpClient]  [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[TranslationAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [JSOpenService] JinShanOpenAPI [OCRService] OCR [JsonResult] init toString builder \n[TranslationAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[TranslationAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[TranslationAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[TranslationAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_0_11", "question": "\nimport io.swagger.annotations.Api;\n package me.", "target": "codegc.apet.server.controller;\n", "answers": ["codegc.apet.server.controller;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_2_10", "question": "import io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\n package me.codegc.apet.server.controller;\n\nimport io.", "target": "swagger.annotations.Api;\n", "answers": ["swagger.annotations.Api;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_3_30", "question": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\n \nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.", "target": "ApiOperation;\n", "answers": ["ApiOperation;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_4_7", "question": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\n import io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport ", "target": "lombok.extern.slf4j.Slf4j;\n", "answers": ["lombok.extern.slf4j.Slf4j;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_5_29", "question": "import me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\n import io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.", "target": "model.JsonResult;\n", "answers": ["model.JsonResult;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_6_7", "question": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\n import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport ", "target": "me.codegc.apet.server.services.JSOpenService;\n", "answers": ["me.codegc.apet.server.services.JSOpenService;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_7_52", "question": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n import me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.", "target": "Autowired;\n", "answers": ["Autowired;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_8_11", "question": "import org.springframework.web.bind.annotation.RestController;\n\n import me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.", "target": "springframework.web.bind.annotation.GetMapping;\n", "answers": ["springframework.web.bind.annotation.GetMapping;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_9_7", "question": "\n/**\n import org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport ", "target": "org.springframework.web.bind.annotation.RestController;\n", "answers": ["org.springframework.web.bind.annotation.RestController;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_20_0", "question": "@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\n  * </p>\n */\n", "target": "@Slf4j\n", "answers": ["@Slf4j\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_21_13", "question": "@RestController\npublic class WelcomeAPI {\n  */\n@Slf4j\n@Api(tags = \"", "target": "Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n", "answers": ["Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_22_0", "question": "public class WelcomeAPI {\n\n @Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n", "target": "@RestController\n", "answers": ["@RestController\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_23_7", "question": "\n    @Autowired\n @Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic ", "target": "class WelcomeAPI {\n", "answers": ["class WelcomeAPI {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_25_3", "question": "    JSOpenService js;\n\n public class WelcomeAPI {\n\n   ", "target": " @Autowired\n", "answers": [" @Autowired\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_26_4", "question": "\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n \n    @Autowired\n    ", "target": "JSOpenService js;\n", "answers": ["JSOpenService js;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_28_19", "question": "    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n     JSOpenService js;\n\n    @ApiOperation(\"", "target": "\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n", "answers": ["\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_29_17", "question": "    public JsonResult welcome_api() {\n\n \n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"", "target": "/welcome/api\")\n", "answers": ["/welcome/api\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder [JSOpenService] JinShanOpenAPI \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_30_4", "question": "\n\n     @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    ", "target": "public JsonResult welcome_api() {\n", "answers": ["public JsonResult welcome_api() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult SUCCESS builder builder js JinShanOpenAPI JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_33_19", "question": "                .init(JsonResult.SUCCESS)\n                .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n \n\n        return new ", "target": "JsonResult()\n", "answers": ["JsonResult()\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init JsonResult SUCCESS builder builder js JinShanOpenAPI", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_34_9", "question": "                .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n                .builder(\"welcome\", js.JinShanOpenAPI());\n \n        return new JsonResult()\n         ", "target": "       .init(JsonResult.SUCCESS)\n", "answers": ["       .init(JsonResult.SUCCESS)\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "builder builder js JinShanOpenAPI", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n         ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_35_17", "question": "                .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n         return new JsonResult()\n                .init(JsonResult.SUCCESS)\n                .", "target": "builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n", "answers": ["builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "builder js JinShanOpenAPI", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_36_16", "question": "    }\n\n                 .init(JsonResult.SUCCESS)\n                .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n                ", "target": ".builder(\"welcome\", js.JinShanOpenAPI());\n", "answers": [".builder(\"welcome\", js.JinShanOpenAPI());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\")", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n                ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_37_0", "question": "\n\n                 .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n                .builder(\"welcome\", js.JinShanOpenAPI());\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/controller/WelcomeAPI.java_40_0", "question": " \n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JSOpenService JsonResult JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "welcome_api", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[UpdateAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation me codegc apet server model JsonResult org springframework web bind annotation GetMapping org springframework web bind annotation RestController Api tags RestController UpdateAPI ApiOperation GetMapping checkUpdate init JsonResult SUCCESS builder JsonResult JsonResult [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services TranslationService org springframework beans factory annotation Autowired org springframework web bind annotation javax servlet http HttpServletRequest javax servlet http HttpServletResponse Api tags RestController RequestMapping TranslationAPI Autowired request Autowired response Autowired t GetMapping test init JsonResult SUCCESS builder System currentTimeMillis ApiOperation value \u5bf9\u5e94\u56fd\u5bb6\u4ee3 GetMapping ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value g\", para query\")  ApiImplicitParam name value \"String ype = \"q  transapi RequestParam Country RequestParam toCountry RequestParam Query Query Country toCountry init JsonResult SUCCESS builder t trans Query Country toCountry init JsonResult ERROR builder HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[UpdateAPI] [checkUpdate]     public JsonResult checkUpdate(){\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"version\",\"1.1.1\");\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationAPI] [test]     public JsonResult test() {\n        return new JsonResult().init(JsonResult.SUCCESS).builder(\"ok\", System.currentTimeMillis());\n    } [transapi] \n        return new JsonResult().init(JsonResult.ERROR).builder(\"message\", \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\");\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n \n[WelcomeAPI]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "@Autowired\n    JSOpenService js;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.controller;\n\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport me.codegc.apet.server.services.JSOpenService;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author: Ding / 2019-03-22 20:13\n * @version: V1.0\n * @TODO: client \u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a7\u5236\u5668\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\n@Api(tags = \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\")\n@RestController\npublic class WelcomeAPI {\n\n    @Autowired\n    JSOpenService js;\n\n    @ApiOperation(\"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\")\n    @GetMapping(\"/welcome/api\")\n    public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    }\n\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[UpdateAPI]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationAPI] @Autowired\n    HttpServletRequest request; @Autowired\n    HttpServletResponse response; @Autowired\n    private TranslationService t; [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; \n[WelcomeAPI]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[UpdateAPI] checkUpdate [AudioAPI] audio_tts [TranslationAPI] test transapi [OCRAPI] OCR \n[WelcomeAPI]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[UpdateAPI] JsonResult JsonResult [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationAPI] HttpServletRequest HttpServletResponse TranslationService JsonResult JsonResult JsonResult String String String JsonResult JsonResult [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult \n[WelcomeAPI]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[UpdateAPI] \"Client\u68c0\u67e5\u66f4\u65b0API\") \"client\u901a\u8fc7\u8fd9\u4e2a\u63a5\u53e3\u68c0\u67e5\u670d\u52a1\u5668\u7248\u672c\") \"/checkUpdate\" \"version\" \"1.1.1\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationAPI] \"\u7ffb\u8bd1API v1.2\") \"/transapi\" \"/test\" \"ok\" \"\u63d0\u4f9b\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u7ffb\u8bd1API\u63a5\u53e3\",notes = \"\u652f\u6301\u5168\u7403\u5404\u7c7b\u8bed\u8a00\u4e92\u76f8\u7ffb\u8bd1,\u4f20 \u5b8c\u6210\u5bf9\u5e94\u7684\u7ffb\u8bd1\u64cd\u4f5c\") \"/from\" \"Country\" \"\u88ab\u7ffb\u8bd1\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \")  \"toCountry\" \"\u9700\u8981\u7ffb\u8bd1\u6210\u90a3\u4e2a\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType = \"Str   \"Query\" \"\u88ab\u7ffb\u8bd1\u7684\u5185\u5bb9\u4ee5\u6587\u672c\u5f62\u5f0f\u4f20\u5165\",required = true,dataType y\")  \"t\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a!\"); [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" \n[WelcomeAPI]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeAPI]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[AudioService] paly [TranslationService] trans [OCRService] OCR [JsonResult] init toString builder \n[WelcomeAPI]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeAPI]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeAPI]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeAPI]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_0_18", "question": "\nimport com.github.kevinsawicki.http.HttpRequest;\n package me.codegc.", "target": "apet.server.utils;\n", "answers": ["apet.server.utils;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_2_36", "question": "import lombok.Data;\n\n package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.", "target": "HttpRequest;\n", "answers": ["HttpRequest;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_3_7", "question": "\nimport java.util.Map;\n \nimport com.github.kevinsawicki.http.HttpRequest;\nimport ", "target": "lombok.Data;\n", "answers": ["lombok.Data;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_5_7", "question": "\n/**\n import lombok.Data;\n\nimport ", "target": "java.util.Map;\n", "answers": ["java.util.Map;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_16_0", "question": "public class HttpClient {\n\n  * </p>\n */\n", "target": "@Data\n", "answers": ["@Data\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_17_0", "question": "\n    private String url;\n  */\n@Data\n", "target": "public class HttpClient {\n", "answers": ["public class HttpClient {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_19_0", "question": "\n\n public class HttpClient {\n\n", "target": "    private String url;\n", "answers": ["    private String url;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_22_11", "question": "        this.url = url;\n        return this;\n \n\n    public ", "target": "HttpClient init(String url){\n", "answers": ["HttpClient init(String url){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_23_13", "question": "        return this;\n    }\n \n    public HttpClient init(String url){\n        this.", "target": "url = url;\n", "answers": ["url = url;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_24_8", "question": "    }\n\n     public HttpClient init(String url){\n        this.url = url;\n        ", "target": "return this;\n", "answers": ["return this;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_25_0", "question": "\n\n         this.url = url;\n        return this;\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_28_18", "question": "        return HttpRequest.get(this.url).body();\n    }\n \n\n    public String ", "target": "get(){\n", "answers": ["get(){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_29_7", "question": "    }\n\n \n    public String get(){\n       ", "target": " return HttpRequest.get(this.url).body();\n", "answers": [" return HttpRequest.get(this.url).body();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n       ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_30_0", "question": "\n    public static String get(String url){\n     public String get(){\n        return HttpRequest.get(this.url).body();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_32_29", "question": "        return HttpRequest.get(url).body();\n    }\n     }\n\n    public static String get(", "target": "String url){\n", "answers": ["String url){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_33_15", "question": "    }\n\n \n    public static String get(String url){\n        return ", "target": "HttpRequest.get(url).body();\n", "answers": ["HttpRequest.get(url).body();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_34_0", "question": "\n    public String get(Map<String,Object> param){\n     public static String get(String url){\n        return HttpRequest.get(url).body();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_36_18", "question": "        return HttpRequest.get(this.url).form(param).body();\n    }\n     }\n\n    public String ", "target": "get(Map<String,Object> param){\n", "answers": ["get(Map<String,Object> param){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_37_8", "question": "    }\n\n \n    public String get(Map<String,Object> param){\n        ", "target": "return HttpRequest.get(this.url).form(param).body();\n", "answers": ["return HttpRequest.get(this.url).form(param).body();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_38_0", "question": "\n    public static String get(String url,Map<String,Object> param){\n     public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_40_29", "question": "        return HttpRequest.get(url).form(param).body();\n    }\n     }\n\n    public static String get(", "target": "String url,Map<String,Object> param){\n", "answers": ["String url,Map<String,Object> param){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_41_15", "question": "    }\n\n \n    public static String get(String url,Map<String,Object> param){\n        return ", "target": "HttpRequest.get(url).form(param).body();\n", "answers": ["HttpRequest.get(url).form(param).body();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "post param HttpRequest post url form param body post url param HttpRequest post url form param body String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_42_0", "question": "\n    public String post(Map<String,Object> param){\n     public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "post param HttpRequest post url form param body post url param HttpRequest post url form param body String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_44_11", "question": "        return HttpRequest.post(this.url).form(param).body();\n    }\n     }\n\n    public ", "target": "String post(Map<String,Object> param){\n", "answers": ["String post(Map<String,Object> param){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HttpRequest post url form param body post url param HttpRequest post url form param body String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_45_47", "question": "    }\n\n \n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(", "target": "param).body();\n", "answers": ["param).body();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "post url param HttpRequest post url form param body String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_46_0", "question": "\n    public static String post(String url,Map<String,Object> param){\n     public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "post url param HttpRequest post url form param body String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_48_11", "question": "        return HttpRequest.post(url).form(param).body();\n    }\n     }\n\n    public ", "target": "static String post(String url,Map<String,Object> param){\n", "answers": ["static String post(String url,Map<String,Object> param){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return HttpRequest.post(url).form(param).body();\n    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HttpRequest post url form param body", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_49_27", "question": "    }\n\n \n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.", "target": "post(url).form(param).body();\n", "answers": ["post(url).form(param).body();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_50_0", "question": "\n}\n     public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/utils/HttpClient.java_52_0", "question": "     }\n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init get get get get post post", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String url;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.utils;\n\nimport com.github.kevinsawicki.http.HttpRequest;\nimport lombok.Data;\n\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 12:42\n * @version: V1.0\n * @TODO: \u81ea\u5df1\u5c01\u88c5\u7684http\u8bf7\u6c42\u5de5\u5177\u7c7b\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class HttpClient {\n\n    private String url;\n\n\n    public HttpClient init(String url){\n        this.url = url;\n        return this;\n    }\n\n\n    public String get(){\n        return HttpRequest.get(this.url).body();\n    }\n\n    public static String get(String url){\n        return HttpRequest.get(url).body();\n    }\n\n    public String get(Map<String,Object> param){\n        return HttpRequest.get(this.url).form(param).body();\n    }\n\n    public static String get(String url,Map<String,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    }\n\n    public String post(Map<String,Object> param){\n        return HttpRequest.post(this.url).form(param).body();\n    }\n\n    public static String post(String url,Map<String,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    }\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_0_23", "question": "\nimport com.alibaba.fastjson.JSONObject;\n package me.codegc.apet.", "target": "server.Interceptor;\n", "answers": ["server.Interceptor;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_2_19", "question": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\n package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.", "target": "fastjson.JSONObject;\n", "answers": ["fastjson.JSONObject;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_3_0", "question": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\n \nimport com.alibaba.fastjson.JSONObject;\n", "target": "import lombok.extern.slf4j.Slf4j;\n", "answers": ["import lombok.extern.slf4j.Slf4j;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_4_0", "question": "import org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n import com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\n", "target": "import me.codegc.apet.server.model.JsonResult;\n", "answers": ["import me.codegc.apet.server.model.JsonResult;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_5_0", "question": "import org.springframework.web.servlet.ModelAndView;\n\n import lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\n", "target": "import org.springframework.web.servlet.HandlerInterceptor;\n", "answers": ["import org.springframework.web.servlet.HandlerInterceptor;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_6_11", "question": "\nimport javax.servlet.http.HttpServletRequest;\n import me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.", "target": "springframework.web.servlet.ModelAndView;\n", "answers": ["springframework.web.servlet.ModelAndView;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_8_26", "question": "import javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\n import org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.", "target": "HttpServletRequest;\n", "answers": ["HttpServletRequest;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_9_0", "question": "import java.util.Arrays;\nimport java.util.HashSet;\n \nimport javax.servlet.http.HttpServletRequest;\n", "target": "import javax.servlet.http.HttpServletResponse;\n", "answers": ["import javax.servlet.http.HttpServletResponse;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_10_17", "question": "import java.util.HashSet;\nimport java.util.Set;\n import javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.", "target": "Arrays;\n", "answers": ["Arrays;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_11_17", "question": "import java.util.Set;\n\n import javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.", "target": "HashSet;\n", "answers": ["HashSet;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_12_12", "question": "\n/**\n import java.util.Arrays;\nimport java.util.HashSet;\nimport java.", "target": "util.Set;\n", "answers": ["util.Set;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_23_0", "question": "public class DomainInterceptor implements HandlerInterceptor {\n\n  * </p>\n */\n", "target": "@Slf4j\n", "answers": ["@Slf4j\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_24_13", "question": "\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n  */\n@Slf4j\npublic class ", "target": "DomainInterceptor implements HandlerInterceptor {\n", "answers": ["DomainInterceptor implements HandlerInterceptor {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_27_4", "question": "\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n \n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    ", "target": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n", "answers": ["private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_29_75", "question": "\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n     private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.", "target": "asList(allowDomain));\n", "answers": ["asList(allowDomain));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_32_4", "question": "    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n \n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    ", "target": "@Override\n", "answers": ["@Override\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_33_110", "question": "\n        String originHeader = request.getHeader(\"Origin\");\n     //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ", "target": "Exception {\n", "answers": ["Exception {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_35_15", "question": "        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String ", "target": "originHeader = request.getHeader(\"Origin\");\n", "answers": ["originHeader = request.getHeader(\"Origin\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_36_27", "question": "            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n \n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.", "target": "contains(originHeader)) {\n", "answers": ["contains(originHeader)) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_37_8", "question": "            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n         String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n        ", "target": "    response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n", "answers": ["    response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_38_32", "question": "            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n         if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"", "target": "Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n", "answers": ["Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_39_68", "question": "            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n             response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET,", "target": " HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n", "answers": [" HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET,", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_40_9", "question": "            return  true;\n        }\n             response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n         ", "target": "   response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n", "answers": ["   response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n         ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_41_5", "question": "        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n             response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n     ", "target": "       return  true;\n", "answers": ["       return  true;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n     ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_42_0", "question": "        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n             response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_43_17", "question": "        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n             return  true;\n        }\n        response.", "target": "setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n", "answers": ["setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_44_8", "question": "        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list .{}\",request.changeSessionId());\n         }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        ", "target": "response.setCharacterEncoding(\"UTF-8\");\n", "answers": ["response.setCharacterEncoding(\"UTF-8\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_45_8", "question": "        log.info(\"This domain name is not on the white list .{}\",request.changeSessionId());\n        return false;\n         response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        ", "target": "response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n", "answers": ["response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "log info request changeSessionId", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_46_5", "question": "        return false;\n    }\n         response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n     ", "target": "   log.info(\"This domain name is not on the white list .{}\",request.changeSessionId());\n", "answers": ["   log.info(\"This domain name is not on the white list .{}\",request.changeSessionId());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n     ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_47_4", "question": "    }\n\n         response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list .{}\",request.changeSessionId());\n    ", "target": "    return false;\n", "answers": ["    return false;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_48_0", "question": "\n//    @Override\n         log.info(\"This domain name is not on the white list .{}\",request.changeSessionId());\n        return false;\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/Interceptor/DomainInterceptor.java_60_0", "question": " //    }\n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "preHandle", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[DomainInterceptor]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.Interceptor;\n\nimport com.alibaba.fastjson.JSONObject;\nimport lombok.extern.slf4j.Slf4j;\nimport me.codegc.apet.server.model.JsonResult;\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * @author: Ding / 2019-03-23 16:45\n * @version: V1.0\n * @TODO: \u6ca1\u6709\u8bb8\u53ef\u57df\u540d\u5168\u90e8\u62e6\u622a\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Slf4j\npublic class DomainInterceptor implements HandlerInterceptor {\n\n    // \u5141\u8bb8\u8de8\u57df\u8bf7\u6c42 \u8fd9\u91cc\u53ef\u4ee5\u653e\u5165\u4f60\u7684\u57df\u540d \u8fd9\u91cc\u7ed9\u4f60\u540e\u671f\u53ef\u4ee5\u4ece\u6570\u636e\u5e93\u91cc\u62ff\n    private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null};\n\n    private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain));\n\n    //\u914d\u7f6e\u57df\u540d\u62e6\u622a\u5668 \u9632\u6b62\u4e0d\u5728\u7b2c\u4e09\u65b9\u8de8\u57df\u8bf7\u6c42\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    }\n\n//    @Override\n//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n//\n//    }\n//\n//    @Override\n//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n//\n//    }\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[DomainInterceptor]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[DomainInterceptor]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[DomainInterceptor]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[DomainInterceptor]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainInterceptor]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainInterceptor]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainInterceptor]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainInterceptor]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainInterceptor]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainInterceptor]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainInterceptor]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainInterceptor]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainInterceptor]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainInterceptor]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_0_30", "question": "\nimport com.github.JDode.JTesseract.JTesseract;\n package me.codegc.apet.server.", "target": "services;\n", "answers": ["services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_2_11", "question": "import com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n package me.codegc.apet.server.services;\n\nimport com.", "target": "github.JDode.JTesseract.JTesseract;\n", "answers": ["github.JDode.JTesseract.JTesseract;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_3_7", "question": "import org.springframework.stereotype.Component;\n\n \nimport com.github.JDode.JTesseract.JTesseract;\nimport ", "target": "com.github.JDode.JTesseract.model.Tesseract;\n", "answers": ["com.github.JDode.JTesseract.model.Tesseract;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_4_27", "question": "\nimport java.io.File;\n import com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.", "target": "stereotype.Component;\n", "answers": ["stereotype.Component;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_6_0", "question": "\n/**\n import org.springframework.stereotype.Component;\n\n", "target": "import java.io.File;\n", "answers": ["import java.io.File;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_15_0", "question": "public class OCRService {\n\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "target": "@Component\n", "answers": ["@Component\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_16_13", "question": "\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n  */\n@Component\npublic class ", "target": "OCRService {\n", "answers": ["OCRService {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_18_35", "question": "\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n public class OCRService {\n\n    private final String CONFIG = \"", "target": "/Users/jdode/Desktop/tesseract.properties\";\n", "answers": ["/Users/jdode/Desktop/tesseract.properties\";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init init build CONFIG OCR file init setFile file init OCR JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_21_34", "question": "\n    public String OCR(String file) {\n \n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init ", "target": "= new JTesseract().init(new Tesseract().build(CONFIG));\n", "answers": ["= new JTesseract().init(new Tesseract().build(CONFIG));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "OCR file init setFile file init OCR String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_23_22", "question": "        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n     private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(", "target": "String file) {\n", "answers": ["String file) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init setFile file init OCR File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_25_25", "question": "        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new ", "target": "File(file));\n", "answers": ["File(file));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init OCR", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_26_3", "question": "        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n         //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n   ", "target": "     return init.OCR();\n", "answers": ["     return init.OCR();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_28_0", "question": "}\n         return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/OCRService.java_29_0", "question": "         //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JTesseract JTesseract Tesseract String String File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "OCR", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/Users/jdode/Desktop/tesseract.properties\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation io swagger annotations ApiParam me codegc apet server model JsonResult me codegc apet server services OCRService org springframework beans factory annotation Autowired org springframework web bind annotation PostMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RestController org springframework web multipart MultipartFile java io File java io IOException Api tags RestController RequestMapping OCRAPI FILEPATH Autowired ocrService ApiOperation value \"OCR\u76ee PostMapping value headers OCR ApiParam value e) file file isEmpty file init JsonResult ERROR builder fileName file getOriginalFilename dest FILEPATH fileName file transferTo dest e init JsonResult ERROR builder init JsonResult SUCCESS builder builder ocrService OCR dest getPath String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [OCRAPI] [OCR]     public JsonResult OCR(@ApiParam(value = \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = true)\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[OCRService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.github.JDode.JTesseract.JTesseract;\nimport com.github.JDode.JTesseract.model.Tesseract;\nimport org.springframework.stereotype.Component;\n\nimport java.io.File;\n\n/**\n * Created by Ding on 2019/4/4 11:42 AM.\n *\n * @Description: OCR\u670d\u52a1\u7c7b\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class OCRService {\n\n    private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\";\n\n    //\u5b9e\u4f8b\u4e00\u4e2aJTesseract\u5bf9\u8c61\u4f20\u5165\u76f8\u5173\u53c2\u6570\n    private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG));\n\n    public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [OCRAPI] private final String FILEPATH = \"/Users/jdode/Pictures\"; @Autowired\n    OCRService ocrService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[OCRService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [OCRAPI] OCR [TranslationService] trans [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage [AudioService] paly \n[OCRService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [OCRAPI] String OCRService JsonResult MultipartFile JsonResult String File File IOException JsonResult JsonResult [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[OCRService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [OCRAPI] \"OCR\u56fe\u7247\u63d0\u53d6\u6587\u5b57API v1.3\") \"/ocr\" \"/Users/jdode/Pictures\" \"OCR\u8bc6\u522bAPI\u63a5\u53e3\", notes \u6301\u4e2d\u6587\u6216\u8005\u82f1\u6587\u5185\u5bb9\u56fe\u7247\u8bc6\u522b\") \"/api\" \"content-type=multipart/form-data\" \"\u88ab\u8bc6\u522b\u56fe\u7247\u6587\u4ef6\", required = t \"message\" \"\u4e0a\u4f20\u5931\u8d25\uff0c\u8bf7\u9009\u62e9\u6587\u4ef6~\"); \"error\" \"\u6587\u4ef6\u5904\u7406\u5f02\u5e38\"); \"message\" \"\u6587\u4ef6\u5904\u7406\u6210\u529f~\") \"OCR\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[OCRService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[OCRService] OCR [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[OCRService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[OCRService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[OCRService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[OCRService] String JTesseract JTesseract Tesseract String String File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[OCRService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[OCRService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_0_11", "question": "\nimport org.apache.commons.io.FileUtils;\n package me.", "target": "codegc.apet.server.services;\n", "answers": ["codegc.apet.server.services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_2_29", "question": "import org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.", "target": "FileUtils;\n", "answers": ["FileUtils;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_3_29", "question": "import org.springframework.stereotype.Component;\n\n \nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.", "target": "IOUtils;\n", "answers": ["IOUtils;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_4_11", "question": "\nimport javax.servlet.ServletOutputStream;\n import org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.", "target": "springframework.stereotype.Component;\n", "answers": ["springframework.stereotype.Component;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_6_0", "question": "import javax.servlet.http.HttpServletResponse;\nimport java.io.File;\n import org.springframework.stereotype.Component;\n\n", "target": "import javax.servlet.ServletOutputStream;\n", "answers": ["import javax.servlet.ServletOutputStream;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_7_0", "question": "import java.io.File;\nimport java.io.FileInputStream;\n \nimport javax.servlet.ServletOutputStream;\n", "target": "import javax.servlet.http.HttpServletResponse;\n", "answers": ["import javax.servlet.http.HttpServletResponse;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_8_15", "question": "import java.io.FileInputStream;\nimport java.io.IOException;\n import javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.", "target": "File;\n", "answers": ["File;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_9_15", "question": "import java.io.IOException;\nimport java.net.URL;\n import javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.", "target": "FileInputStream;\n", "answers": ["FileInputStream;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_10_15", "question": "import java.net.URL;\nimport java.util.Map;\n import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.", "target": "IOException;\n", "answers": ["IOException;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_11_7", "question": "import java.util.Map;\n\n import java.io.FileInputStream;\nimport java.io.IOException;\nimport ", "target": "java.net.URL;\n", "answers": ["java.net.URL;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_12_7", "question": "\n/**\n import java.io.IOException;\nimport java.net.URL;\nimport ", "target": "java.util.Map;\n", "answers": ["java.util.Map;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_21_0", "question": "public class AudioService {\n\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "target": "@Component\n", "answers": ["@Component\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_22_13", "question": "\n\n  */\n@Component\npublic class ", "target": "AudioService {\n", "answers": ["AudioService {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_25_41", "question": "\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n \n\n    private final String TTSURL = \"https:", "target": "//fanyi.baidu.com/gettts\";\n", "answers": ["//fanyi.baidu.com/gettts\";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https:", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_27_67", "question": "        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n     private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse ", "target": "response) throws IOException {\n", "answers": ["response) throws IOException {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_28_3", "question": "        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n \n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n   ", "target": "     StringBuffer sb = new StringBuffer();\n", "answers": ["     StringBuffer sb = new StringBuffer();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_30_18", "question": "        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n         StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(", "target": "TTSURL).append(\"?\");\n", "answers": ["TTSURL).append(\"?\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_31_17", "question": "            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n         //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.", "target": "Entry<String, String> stringStringEntry : pram.entrySet()) {\n", "answers": ["Entry<String, String> stringStringEntry : pram.entrySet()) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_32_40", "question": "            sb.append(\"&\");\n        }\n         sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.", "target": "getKey()).append(\"=\").append(stringStringEntry.getValue());\n", "answers": ["getKey()).append(\"=\").append(stringStringEntry.getValue());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_33_2", "question": "        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n         for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n  ", "target": "          sb.append(\"&\");\n", "answers": ["          sb.append(\"&\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_34_0", "question": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n             sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_37_34", "question": "\n        response.setContentType(\"audio/mpeg\");\n         //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.", "target": "currentTimeMillis() + \".mp3\";\n", "answers": ["currentTimeMillis() + \".mp3\";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_39_33", "question": "        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n         String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"", "target": "audio/mpeg\");\n", "answers": ["audio/mpeg\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_42_8", "question": "\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n         //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        ", "target": "FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n", "answers": ["FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_44_46", "question": "\n        ServletOutputStream outputStream = response.getOutputStream();\n         FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new ", "target": "FileInputStream(new File(file_name));\n", "answers": ["FileInputStream(new File(file_name));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_46_8", "question": "        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n         FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ", "target": "ServletOutputStream outputStream = response.getOutputStream();\n", "answers": ["ServletOutputStream outputStream = response.getOutputStream();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_48_21", "question": "        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n         ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(", "target": "fileInputStream, outputStream,2048);\n", "answers": ["fileInputStream, outputStream,2048);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_50_18", "question": "        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n         IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.", "target": "forceDelete(new File(file_name));\n", "answers": ["forceDelete(new File(file_name));\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "IOUtils closeQuietly fileInputStream outputStream", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_51_16", "question": "    }\n}\n         //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.", "target": "closeQuietly(fileInputStream, outputStream);\n", "answers": ["closeQuietly(fileInputStream, outputStream);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_52_0", "question": "}\n         FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/AudioService.java_53_0", "question": "         IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "paly", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] me codegc apet server controller com alibaba fastjson JSONObject io swagger annotations Api io swagger annotations ApiImplicitParam io swagger annotations ApiImplicitParams io swagger annotations ApiOperation me codegc apet server model JsonResult me codegc apet server services AudioService org springframework beans factory annotation Autowired org springframework stereotype Controller org springframework web bind annotation GetMapping org springframework web bind annotation RequestMapping org springframework web bind annotation RequestParam javax servlet http HttpServletResponse java io IOException java util HashMap java util Map Api tags Controller RequestMapping AudioAPI Autowired audioService ApiOperation value \u6587\u5b57\u5373\u53ef\u8f6c ApiImplicitParams ApiImplicitParam name value \"String\" pe = \"qu  ApiImplicitParam name value Type = \" paramTyp  GetMapping audio_tts RequestParam value required defaultValue languageCode RequestParam value required defaultValue text response languageCode isEmpty text isEmpty response setStatus response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder pram pram put languageCode pram put text replaceAll pram put pram put audioService paly pram response AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [AudioAPI] [audio_tts]     public void audio_tts(\n [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [ImageUploadService] [uploadImage]     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    } \n[AudioService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String TTSURL = \"https://fanyi.baidu.com/gettts\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.commons.io.IOUtils;\nimport org.springframework.stereotype.Component;\n\nimport javax.servlet.ServletOutputStream;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/4/4 6:32 PM.\n *\n * @Description: \u8bed\u97f3\u6717\u8bfbAPI\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class AudioService {\n\n\n    private final String TTSURL = \"https://fanyi.baidu.com/gettts\";\n\n    public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [AudioAPI] @Autowired\n    AudioService audioService; [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [ImageUploadService]  \n[AudioService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [AudioAPI] audio_tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [ImageUploadService] uploadImage \n[AudioService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [AudioAPI] AudioService String String HttpServletResponse IOException JsonResult Map String String HashMap [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [ImageUploadService] String MultipartFile String String String File File IOException \n[AudioService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [AudioAPI] \"\u6587\u5b57\u8f6c\u8bed\u97f3mp3\u6587\u4ef6 API v1.8\") \"/mp3\" \"\u6587\u5b57\u8f6c\u8bed\u97f3API\u63a5\u53e3\",notes = \"\u4f20\u5165\u5bf9\u5e94 \u97f3\u6587\u4ef6\") \"languageCode\" \"\u88ab\u6717\u8bfb\u7684\u8bed\u8a00\u6240\u5728\u56fd\u7684\u8bed\u8a00\u4ee3\u7801\", required = true, dataType \"),  \"text\" \"\u88ab\u6717\u8bfb\u7684\u5185\u5bb9\u6587\u672c\u4f20\u5165\",required = true,dat \"query\"  \"/audio\" \"languageCode\" \"\" \"text\" \"\" \"Content-type\" \"text/json;charset=UTF-8\" \"utf-8\" \"message\" \"\u76f8\u5173\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a\uff01\"))); \"lan\" \"text\" \" \" \"\" \"spd\" \"5\" \"source\" \"web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [ImageUploadService] \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\" \n[AudioService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[AudioService] paly [JsonResult] init toString builder [WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[AudioService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[AudioService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[AudioService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[AudioService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[AudioService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_0_30", "question": "\nimport com.alibaba.fastjson.JSONObject;\n package me.codegc.apet.server.", "target": "services;\n", "answers": ["services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_2_19", "question": "import me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\n package me.codegc.apet.server.services;\n\nimport com.alibaba.", "target": "fastjson.JSONObject;\n", "answers": ["fastjson.JSONObject;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_3_17", "question": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n \nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.", "target": "apet.server.model.WelcomeData;\n", "answers": ["apet.server.model.WelcomeData;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_4_35", "question": "import org.springframework.stereotype.Component;\n\n import com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.", "target": "HttpClient;\n", "answers": ["HttpClient;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_5_38", "question": "\nimport java.util.Map;\n import me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.", "target": "Component;\n", "answers": ["Component;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_7_17", "question": "\n/**\n import org.springframework.stereotype.Component;\n\nimport java.util.", "target": "Map;\n", "answers": ["Map;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_16_0", "question": "public class JSOpenService {\n\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "target": "@Component\n", "answers": ["@Component\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_17_7", "question": "\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n  */\n@Component\npublic ", "target": "class JSOpenService {\n", "answers": ["class JSOpenService {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_19_34", "question": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n public class JSOpenService {\n\n    private final String open_url ", "target": "= \"http://open.iciba.com/dsapi/\";\n", "answers": ["= \"http://open.iciba.com/dsapi/\";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_21_18", "question": "\n    public WelcomeData JinShanOpenAPI() {\n     private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final ", "target": "HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n", "answers": ["HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_23_23", "question": "        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n     private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData ", "target": "JinShanOpenAPI() {\n", "answers": ["JinShanOpenAPI() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_24_3", "question": "        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n \n    public WelcomeData JinShanOpenAPI() {\n   ", "target": "     Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n", "answers": ["     Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_25_38", "question": "        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new ", "target": "WelcomeData();\n", "answers": ["WelcomeData();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_26_4", "question": "        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n         Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n    ", "target": "    welcomeData.setIcon(\"./icon.png\");\n", "answers": ["    welcomeData.setIcon(\"./icon.png\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_27_8", "question": "        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n         WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        ", "target": "welcomeData.setContent(map.get(\"content\").toString());\n", "answers": ["welcomeData.setContent(map.get(\"content\").toString());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "welcomeData setMpegUrl map get toString welcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_28_8", "question": "        return welcomeData;\n    }\n         welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        ", "target": "welcomeData.setMpegUrl(map.get(\"tts\").toString());\n", "answers": ["welcomeData.setMpegUrl(map.get(\"tts\").toString());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return welcomeData;\n    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return welcomeData;\n    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return welcomeData;\n    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "welcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_29_2", "question": "    }\n\n         welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n  ", "target": "      return welcomeData;\n", "answers": ["      return welcomeData;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_30_0", "question": "\n\n         welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/JSOpenService.java_33_0", "question": " \n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "JinShanOpenAPI", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } \n[JSOpenService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.model.WelcomeData;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.Map;\n\n/**\n * Created by Ding on 2019/3/30 12:32 PM.\n *\n * @Description: \u91d1\u5c71\u5f00\u53d1API\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Component\npublic class JSOpenService {\n\n    private final String open_url = \"http://open.iciba.com/dsapi/\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(open_url);\n\n    public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    }\n\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); \n[JSOpenService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[TranslationService] trans \n[JSOpenService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map \n[JSOpenService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" \n[JSOpenService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JSOpenService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[JSOpenService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[JSOpenService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[JSOpenService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[JSOpenService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[JSOpenService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[JSOpenService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[JSOpenService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[JSOpenService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  \n[JSOpenService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[JSOpenService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_0_23", "question": "\nimport com.alibaba.fastjson.JSONObject;\n package me.codegc.apet.", "target": "server.services;\n", "answers": ["server.services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_2_28", "question": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.", "target": "JSONObject;\n", "answers": ["JSONObject;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_3_17", "question": "import org.springframework.stereotype.Component;\n\n \nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.", "target": "apet.server.utils.HttpClient;\n", "answers": ["apet.server.utils.HttpClient;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_4_38", "question": "\nimport java.util.HashMap;\n import com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.", "target": "Component;\n", "answers": ["Component;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_6_7", "question": "import java.util.Map;\n\n import org.springframework.stereotype.Component;\n\nimport ", "target": "java.util.HashMap;\n", "answers": ["java.util.HashMap;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_7_0", "question": "\n/**\n \nimport java.util.HashMap;\n", "target": "import java.util.Map;\n", "answers": ["import java.util.Map;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_18_0", "question": "public class TranslationService {\n\n  * </p>\n */\n", "target": "@Component\n", "answers": ["@Component\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_19_13", "question": "\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n  */\n@Component\npublic class ", "target": "TranslationService {\n", "answers": ["TranslationService {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_21_19", "question": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n public class TranslationService {\n\n    private final  ", "target": "String URL = \"https://fanyi.baidu.com/transapi\";\n", "answers": ["String URL = \"https://fanyi.baidu.com/transapi\";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_23_29", "question": "\n    public Map trans(String query,String Country,String toCountry){\n     private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient ", "target": "HTTPCLIENT = new HttpClient().init(URL);\n", "answers": ["HTTPCLIENT = new HttpClient().init(URL);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\";", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_25_49", "question": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n     private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,", "target": "String toCountry){\n", "answers": ["String toCountry){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_26_19", "question": "        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n \n    public Map trans(String query,String Country,String toCountry){\n        Map<String,", "target": "Object> param = new HashMap();\n", "answers": ["Object> param = new HashMap();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_27_4", "question": "        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n    ", "target": "    param.put(\"from\",Country);\n", "answers": ["    param.put(\"from\",Country);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param put toCountry param put query JSONObject parseObject HTTPCLIENT get param Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_28_7", "question": "        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n         Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n       ", "target": " param.put(\"to\",toCountry);\n", "answers": [" param.put(\"to\",toCountry);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "param put query JSONObject parseObject HTTPCLIENT get param Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n       ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_29_14", "question": "        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n         param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.", "target": "put(\"query\",query);\n", "answers": ["put(\"query\",query);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "JSONObject parseObject HTTPCLIENT get param Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_30_8", "question": "    }\n\n         param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        ", "target": "return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n", "answers": ["return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query String HttpClient HttpClient Map String String String Map String Object HashMap", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_31_0", "question": "\n\n         param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n\n\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n\n\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n\n\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/TranslationService.java_35_0", "question": " \n\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String HttpClient HttpClient Map String String String Map String Object HashMap Map", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "trans", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } \n[TranslationService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL);", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport com.alibaba.fastjson.JSONObject;\nimport me.codegc.apet.server.utils.HttpClient;\nimport org.springframework.stereotype.Component;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-23 13:08\n * @version: V1.0\n * @TODO: \u7ffb\u8bd1service\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Component\npublic class TranslationService {\n\n    private final  String URL = \"https://fanyi.baidu.com/transapi\";\n\n    private final HttpClient HTTPCLIENT = new HttpClient().init(URL);\n\n    public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    }\n\n\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); \n[TranslationService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI \n[TranslationService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData \n[TranslationService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" \n[TranslationService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[TranslationService]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); [HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[TranslationService] trans [JsonResult] init toString builder [HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" [HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[TranslationService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } [WelcomeData]  \n[TranslationService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[HttpClient] private String url; \n[TranslationService]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[HttpClient] init get get get get post post \n[TranslationService]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[HttpClient]  \n[TranslationService]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[HttpClient] init get get get get post post [WelcomeData]  \n[TranslationService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[HttpClient] private String url; [WelcomeData] private String content; private String icon; private String mpegUrl; \n[TranslationService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[TranslationService]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[HttpClient]  [WelcomeData]  \n[TranslationService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object [WelcomeData] String String String \n[TranslationService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_0_23", "question": "\nimport lombok.extern.slf4j.Slf4j;\n package me.codegc.apet.", "target": "server.services;\n", "answers": ["server.services;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_2_0", "question": "import org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\n package me.codegc.apet.server.services;\n\n", "target": "import lombok.extern.slf4j.Slf4j;\n", "answers": ["import lombok.extern.slf4j.Slf4j;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_3_18", "question": "import org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n \nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.", "target": "commons.io.FileUtils;\n", "answers": ["commons.io.FileUtils;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_4_38", "question": "import org.springframework.web.multipart.MultipartFile;\n\n import lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.", "target": "Component;\n", "answers": ["Component;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_5_11", "question": "\nimport java.io.File;\n import org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.", "target": "springframework.web.multipart.MultipartFile;\n", "answers": ["springframework.web.multipart.MultipartFile;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_7_15", "question": "import java.io.IOException;\n\n import org.springframework.web.multipart.MultipartFile;\n\nimport java.io.", "target": "File;\n", "answers": ["File;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_8_15", "question": "\n/**\n \nimport java.io.File;\nimport java.io.", "target": "IOException;\n", "answers": ["IOException;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_17_0", "question": "@Component\npublic class ImageUploadService {\n  * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "target": "@Slf4j\n", "answers": ["@Slf4j\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_18_0", "question": "public class ImageUploadService {\n    /**\n  */\n@Slf4j\n", "target": "@Component\n", "answers": ["@Component\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_19_13", "question": "    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n @Slf4j\n@Component\npublic class ", "target": "ImageUploadService {\n", "answers": ["ImageUploadService {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_28_49", "question": "\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n      * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file,", "target": " String uploadPath, String physicalUploadPath) {\n", "answers": [" String uploadPath, String physicalUploadPath) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file,", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_30_15", "question": "\n        try {\n     public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String ", "target": "filePath = physicalUploadPath + file.getOriginalFilename();\n", "answers": ["filePath = physicalUploadPath + file.getOriginalFilename();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_32_4", "question": "            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n         String filePath = physicalUploadPath + file.getOriginalFilename();\n\n    ", "target": "    try {\n", "answers": ["    try {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_33_30", "question": "            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n \n        try {\n            File targetFile = ", "target": "new File(filePath);\n", "answers": ["new File(filePath);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_34_2", "question": "        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n         try {\n            File targetFile = new File(filePath);\n  ", "target": "          FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n", "answers": ["          FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "e log error e getMessage e printStackTrace uploadPath file getOriginalFilename IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_35_2", "question": "            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n             File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n  ", "target": "      } catch (IOException e) {\n", "answers": ["      } catch (IOException e) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "log error e getMessage e printStackTrace uploadPath file getOriginalFilename", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_36_24", "question": "            e.printStackTrace();\n        }\n             FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.", "target": "getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n", "answers": ["getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "e printStackTrace uploadPath file getOriginalFilename", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_37_9", "question": "        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n         } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n         ", "target": "   e.printStackTrace();\n", "answers": ["   e.printStackTrace();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "uploadPath file getOriginalFilename", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n         ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_38_0", "question": "        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n             log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n", "target": "        }\n", "answers": ["        }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "uploadPath file getOriginalFilename", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_39_8", "question": "    }\n}\n             e.printStackTrace();\n        }\n        ", "target": "return uploadPath + \"/\" + file.getOriginalFilename();\n", "answers": ["return uploadPath + \"/\" + file.getOriginalFilename();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_40_0", "question": "}\n         }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/services/ImageUploadService.java_41_0", "question": "         return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server services lombok extern slf4j Slf4j org apache commons io FileUtils org springframework stereotype Component org springframework web multipart MultipartFile java io File java io IOException Slf4j Component ImageUploadService uploadImage file uploadPath physicalUploadPath filePath physicalUploadPath file getOriginalFilename targetFile filePath FileUtils writeByteArrayToFile targetFile file getBytes e log error e getMessage e printStackTrace uploadPath file getOriginalFilename String MultipartFile String String String File File IOException", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String MultipartFile String String String File File IOException", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "uploadImage", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\"); \"/\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JingSanOpenServiceTest] me codegc apet server services org junit Test JingSanOpenServiceTest Test jingSanOpenAPI js System out println js JinShanOpenAPI JSOpenService JSOpenService [AudioServiceTest] me codegc apet server services org junit Test java io IOException AudioServiceTest Test paly IOException [TranslationServiceTest] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org junit Test java util HashMap java util Map TranslationServiceTest Test toEN param param put param put param put s init get param map JSONObject parseObject s s1 JSONObject toJSONString s System out println s1 Test tts bytes init get getBytes Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server utils HttpClient org springframework stereotype Component java util HashMap java util Map Component TranslationService URL HTTPCLIENT init URL trans query Country toCountry param param put Country param put toCountry param put query JSONObject parseObject HTTPCLIENT get param String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] me codegc apet server services com github JDode JTesseract JTesseract com github JDode JTesseract model Tesseract org springframework stereotype Component java io File Component OCRService CONFIG init init build CONFIG OCR file init setFile file init OCR String JTesseract JTesseract Tesseract String String File [JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] me codegc apet server services org apache commons io FileUtils org apache commons io IOUtils org springframework stereotype Component javax servlet ServletOutputStream javax servlet http HttpServletResponse java io File java io FileInputStream java io IOException java net URL java util Map Component AudioService TTSURL paly pram response sb sb append TTSURL append stringStringEntry pram entrySet sb append stringStringEntry getKey append append stringStringEntry getValue sb append file_name System currentTimeMillis response setContentType FileUtils copyURLToFile sb toString file_name fileInputStream file_name outputStream response getOutputStream IOUtils copy fileInputStream outputStream FileUtils forceDelete file_name IOUtils closeQuietly fileInputStream outputStream String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JingSanOpenServiceTest] [jingSanOpenAPI]     public void jingSanOpenAPI() {\n        JSOpenService js = new JSOpenService();\n        System.out.println(js.JinShanOpenAPI());\n    } [AudioServiceTest] [paly]     public void paly() throws IOException {\n//        AudioService audioService = new AudioService();\n//        Map<String,String> pram = new HashMap();\n//        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n//        pram.put(\"lan\",\"en\");\n//        pram.put(\"text\",\"hello\");\n//        pram.put(\"spd\",\"5\");\n//        pram.put(\"source\",\"web\");\n//        audioService.paly(pram,null);\n    } [TranslationServiceTest] [toEN]     public void toEN() {\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",\"zh\");\n        param.put(\"to\",\"en\");\n        param.put(\"query\",\"\u60a8\u597d\");\n        String s = new HttpClient().init(\"https://fanyi.baidu.com/transapi\").get(param);\n        Map map = JSONObject.parseObject(s, Map.class);\n        String s1 = JSONObject.toJSONString(s);\n\n        System.out.println(s1);\n    } [tts]     public void tts(){\n        byte[] bytes = new HttpClient().init(\"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\").get().getBytes();\n\n    } [TranslationService] [trans]     public Map trans(String query,String Country,String toCountry){\n        Map<String,Object> param = new HashMap();\n        param.put(\"from\",Country);\n        param.put(\"to\",toCountry);\n        param.put(\"query\",query);\n        return JSONObject.parseObject(HTTPCLIENT.get(param),Map.class);\n    } [OCRService] [OCR]     public String OCR(String file) {\n        //\u4f20\u5165\u88ab\u8bc6\u522b\u6587\u5b57\u7684\u56fe\u7247\n        init.setFile(new File(file));\n        return init.OCR();\n        //return  \"OCR\u670d\u52a1\u5668\u76ee\u524d\u6ca1\u6709\u5f00\u653e\u4f7f\u7528\uff01\uff01\u6709\u95ee\u9898\u8054\u7cfbQ2420498526\";\n    } [JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [AudioService] [paly]     public void paly(Map<String, String> pram, HttpServletResponse response) throws IOException {\n        StringBuffer sb = new StringBuffer();\n        //\u5f00\u59cb\u904d\u5386\u62fc\u63a5URL\n        sb.append(TTSURL).append(\"?\");\n        for (Map.Entry<String, String> stringStringEntry : pram.entrySet()) {\n            sb.append(stringStringEntry.getKey()).append(\"=\").append(stringStringEntry.getValue());\n            sb.append(\"&\");\n        }\n        //https://fanyi.baidu.com/gettts?lan=en&text=spring!&spd=3&source=web\n        //System.out.println(sb);\n        String file_name = System.currentTimeMillis() + \".mp3\";\n\n        response.setContentType(\"audio/mpeg\");\n        //response.addHeader(\"Content-Disposition\", \"attachment;filename=\" + file_name);\n        //\u901a\u8fc7Apache commons-io\u8fd9\u4e2a\u5305\u5bfc \u8bfb\u53d6\u7f51\u7edc\u6587\u4ef6\n        FileUtils.copyURLToFile(new URL(sb.toString()), new File(file_name));\n\n        FileInputStream fileInputStream = new FileInputStream(new File(file_name));\n\n        ServletOutputStream outputStream = response.getOutputStream();\n        // 10.\u6d41\u5bf9\u62f7\n        IOUtils.copy(fileInputStream, outputStream,2048);\n        //\u5220\u9664\u6587\u4ef6\n        FileUtils.forceDelete(new File(file_name));\n        IOUtils.closeQuietly(fileInputStream, outputStream);\n    } \n[ImageUploadService]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.services;\n\nimport lombok.extern.slf4j.Slf4j;\nimport org.apache.commons.io.FileUtils;\nimport org.springframework.stereotype.Component;\nimport org.springframework.web.multipart.MultipartFile;\n\nimport java.io.File;\nimport java.io.IOException;\n\n/**\n * Created by Ding on 2019/4/4 12:10 PM.\n *\n * @Description: \u6587\u4ef6\u4e0a\u4f20service\n * <p>\n * <a href=\"https://github.com/JDode\">to see GitHub</a>\n */\n@Slf4j\n@Component\npublic class ImageUploadService {\n    /**\n     * \u529f\u80fd\uff1a\u4e0a\u4f20\u56fe\u7247\n     *\n     * @param file               \u6587\u4ef6\n     * @param uploadPath         \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u8def\u5f84\n     * @param physicalUploadPath \u670d\u52a1\u5668\u4e0a\u4e0a\u4f20\u6587\u4ef6\u7684\u7269\u7406\u8def\u5f84\n     * @return \u4e0a\u4f20\u6587\u4ef6\u7684 URL\u76f8\u5bf9\u5730\u5740\n     */\n    public String uploadImage(MultipartFile file, String uploadPath, String physicalUploadPath) {\n\n        String filePath = physicalUploadPath + file.getOriginalFilename();\n\n        try {\n            File targetFile = new File(filePath);\n            FileUtils.writeByteArrayToFile(targetFile, file.getBytes());\n        } catch (IOException e) {\n            log.error(e.getMessage() + \"\u6587\u4ef6\u4e0a\u4f20\u51fa\u73b0\u5f02\u5e38~\");\n            e.printStackTrace();\n        }\n        return uploadPath + \"/\" + file.getOriginalFilename();\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest]  [TranslationService] private final  String URL = \"https://fanyi.baidu.com/transapi\"; private final HttpClient HTTPCLIENT = new HttpClient().init(URL); [OCRService] private final String CONFIG = \"/Users/jdode/Desktop/tesseract.properties\"; private final JTesseract init = new JTesseract().init(new Tesseract().build(CONFIG)); [JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [AudioService] private final String TTSURL = \"https://fanyi.baidu.com/gettts\"; \n[ImageUploadService]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JingSanOpenServiceTest] jingSanOpenAPI [AudioServiceTest] paly [TranslationServiceTest] toEN tts [TranslationService] trans [OCRService] OCR [JSOpenService] JinShanOpenAPI [AudioService] paly \n[ImageUploadService]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JingSanOpenServiceTest] JSOpenService JSOpenService [AudioServiceTest] IOException [TranslationServiceTest] Map String Object HashMap String HttpClient Map Map String HttpClient [TranslationService] String HttpClient HttpClient Map String String String Map String Object HashMap Map [OCRService] String JTesseract JTesseract Tesseract String String File [JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [AudioService] String Map String String HttpServletResponse IOException StringBuffer StringBuffer Map Entry String String String URL File FileInputStream FileInputStream File ServletOutputStream File \n[ImageUploadService]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JingSanOpenServiceTest]  [AudioServiceTest]  [TranslationServiceTest] \"from\" \"zh\" \"to\" \"en\" \"query\" \"\u60a8\u597d\"); \"https://fanyi.baidu.com/transapi\" \"https://fanyi.baidu.com/gettts?lan=en&text=Hello!&spd=3&source=web\" [TranslationService] \"https://fanyi.baidu.com/transapi\" \"from\" \"to\" \"query\" [OCRService] \"/Users/jdode/Desktop/tesseract.properties\" [JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [AudioService] \"https://fanyi.baidu.com/gettts\" \"?\" \"=\" \"&\" \".mp3\" \"audio/mpeg\" \n[ImageUploadService]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String [HttpClient] me codegc apet server utils com github kevinsawicki http HttpRequest lombok Data java util Map Data HttpClient url init url url url get HttpRequest get url body get url HttpRequest get url body get param HttpRequest get url form param body get url param HttpRequest get url form param body post param HttpRequest post url form param body post url param HttpRequest post url form param body String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  [HttpClient] [init]     public HttpClient init(String url){\n        this.url = url;\n        return this;\n    } [get]     public String get(){\n        return HttpRequest.get(this.url).body();\n    } [get]   public static String get(String url){\n        return HttpRequest.get(url).body();\n    } [get] > param){\n        return HttpRequest.get(this.url).form(param).body();\n    } [get] ,Object> param){\n        return HttpRequest.get(url).form(param).body();\n    } [post] > param){\n        return HttpRequest.post(this.url).form(param).body();\n    } [post] ,Object> param){\n        return HttpRequest.post(url).form(param).body();\n    } \n[ImageUploadService]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[WelcomeData]  [HttpClient] init get get get get post post \n[ImageUploadService]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; [HttpClient] private String url; \n[ImageUploadService]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[WelcomeData]  [HttpClient]  \n[ImageUploadService]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String [HttpClient] String HttpClient String String String String String Map String Object String String Map String Object String Map String Object String String Map String Object \n[ImageUploadService]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_0_0", "question": "\nimport lombok.Data;\n ", "target": "package me.codegc.apet.server.model;\n", "answers": ["package me.codegc.apet.server.model;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "lombok Data Data WelcomeData content icon mpegUrl String String String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String content; private String icon; private String mpegUrl;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.0625}, {"title": "codex", "text": "", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_2_14", "question": "\n/**\n package me.codegc.apet.server.model;\n\nimport lombok.", "target": "Data;\n", "answers": ["Data;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Data WelcomeData content icon mpegUrl String String String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String content; private String icon; private String mpegUrl;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_13_0", "question": "public class WelcomeData {\n\n  * </p>\n */\n", "target": "@Data\n", "answers": ["@Data\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "WelcomeData content icon mpegUrl String String String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String content; private String icon; private String mpegUrl;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_14_13", "question": "\n    private String content;\n  */\n@Data\npublic class ", "target": "WelcomeData {\n", "answers": ["WelcomeData {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "content icon mpegUrl String String String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String content; private String icon; private String mpegUrl;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_16_19", "question": "\n    private String icon;\n public class WelcomeData {\n\n    private String ", "target": "content;\n", "answers": ["content;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private String icon;\n\n    private String mpegUrl;\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "icon mpegUrl String String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[WelcomeData]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String icon; private String mpegUrl;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[WelcomeData]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n[WelcomeData]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n[WelcomeData]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[WelcomeData]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeData]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_18_4", "question": "\n    private String mpegUrl;\n     private String content;\n\n    ", "target": "private String icon;\n", "answers": ["private String icon;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private String mpegUrl;\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private String mpegUrl;\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private String mpegUrl;\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "mpegUrl String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[WelcomeData]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String mpegUrl;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[WelcomeData]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n[WelcomeData]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n[WelcomeData]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[WelcomeData]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeData]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_20_12", "question": "}\n     private String icon;\n\n    private ", "target": "String mpegUrl;\n", "answers": ["String mpegUrl;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model lombok Data Data WelcomeData content icon String String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[WelcomeData]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String content; private String icon;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[WelcomeData]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n[WelcomeData]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n[WelcomeData]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[WelcomeData]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeData]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/WelcomeData.java_21_0", "question": " \n    private String mpegUrl;\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String String String", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[WelcomeAPI] me codegc apet server controller io swagger annotations Api io swagger annotations ApiOperation lombok extern slf4j Slf4j me codegc apet server model JsonResult me codegc apet server services JSOpenService org springframework beans factory annotation Autowired org springframework web bind annotation GetMapping org springframework web bind annotation RestController Slf4j Api tags RestController WelcomeAPI Autowired js ApiOperation GetMapping welcome_api init JsonResult SUCCESS builder builder js JinShanOpenAPI JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[WelcomeAPI] [welcome_api]     public JsonResult welcome_api() {\n\n\n        return new JsonResult()\n               .init(JsonResult.SUCCESS)\n               .builder(\"message\", \"\u8bf7\u6c42\u6210\u529f\")\n               .builder(\"welcome\", js.JinShanOpenAPI());\n    } \n[WelcomeData]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private String content; private String icon; private String mpegUrl;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[WelcomeData]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\n/**\n * @author: Ding / 2019-03-22 20:47\n * @version: V1.0\n * @TODO: \u542f\u52a8\u9875\u6570\u636e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class WelcomeData {\n\n    private String content;\n\n    private String icon;\n\n    private String mpegUrl;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[WelcomeAPI] @Autowired\n    JSOpenService js; \n[WelcomeData]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[WelcomeAPI] welcome_api \n[WelcomeData]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[WelcomeAPI] JSOpenService JsonResult JsonResult \n[WelcomeData]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[WelcomeAPI] \"Welcome\u9875\u9762\u6b22\u8fceAPI v1.5\") \"\u5ba2\u6237\u7aef\u542f\u52a8\u9875\u7684API\u6570\u636e\u8c03\u7528\u63a5\u53e3\") \"/welcome/api\" \"message\" \"\u8bf7\u6c42\u6210\u529f\") \"welcome\" \n[WelcomeData]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JSOpenService] me codegc apet server services com alibaba fastjson JSONObject me codegc apet server model WelcomeData me codegc apet server utils HttpClient org springframework stereotype Component java util Map Component JSOpenService open_url HTTPCLIENT init open_url JinShanOpenAPI map JSONObject parseObject HTTPCLIENT get welcomeData welcomeData setIcon welcomeData setContent map get toString welcomeData setMpegUrl map get toString welcomeData String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JSOpenService] [JinShanOpenAPI]     public WelcomeData JinShanOpenAPI() {\n        Map map = JSONObject.parseObject(HTTPCLIENT.get(), Map.class);\n        WelcomeData welcomeData = new WelcomeData();\n        welcomeData.setIcon(\"./icon.png\");\n        welcomeData.setContent(map.get(\"content\").toString());\n        welcomeData.setMpegUrl(map.get(\"tts\").toString());\n        return welcomeData;\n    } [JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[WelcomeData]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JSOpenService] private final String open_url = \"http://open.iciba.com/dsapi/\"; private final HttpClient HTTPCLIENT = new HttpClient().init(open_url); [JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[WelcomeData]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JSOpenService] JinShanOpenAPI [JsonResult] init toString builder \n[WelcomeData]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JSOpenService] \"http://open.iciba.com/dsapi/\" \"./icon.png\" \"content\" \"tts\" [JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[WelcomeData]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JSOpenService] String HttpClient HttpClient WelcomeData Map Map WelcomeData WelcomeData [JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[WelcomeData]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_0_18", "question": "\nimport lombok.Data;\n package me.codegc.", "target": "apet.server.model;\n", "answers": ["apet.server.model;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_2_0", "question": "\nimport java.io.Serializable;\n package me.codegc.apet.server.model;\n\n", "target": "import lombok.Data;\n", "answers": ["import lombok.Data;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_4_15", "question": "import java.util.HashMap;\nimport java.util.Map;\n import lombok.Data;\n\nimport java.io.", "target": "Serializable;\n", "answers": ["Serializable;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_5_0", "question": "import java.util.Map;\n\n \nimport java.io.Serializable;\n", "target": "import java.util.HashMap;\n", "answers": ["import java.util.HashMap;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_6_20", "question": "\n/**\n import java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map", "target": ";\n", "answers": [";\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_17_0", "question": "public class JsonResult implements Serializable {\n\n  * </p>\n */\n", "target": "@Data\n", "answers": ["@Data\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_18_24", "question": "\n    private static final long serialVersionUID = -2100472103515439247L;\n  */\n@Data\npublic class JsonResult ", "target": "implements Serializable {\n", "answers": ["implements Serializable {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_20_25", "question": "\n    public  static final int SUCCESS = 200;\n public class JsonResult implements Serializable {\n\n    private static final ", "target": "long serialVersionUID = -2100472103515439247L;\n", "answers": ["long serialVersionUID = -2100472103515439247L;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_22_12", "question": "    public  static final int ERROR = 500;\n\n     private static final long serialVersionUID = -2100472103515439247L;\n\n    public  ", "target": "static final int SUCCESS = 200;\n", "answers": ["static final int SUCCESS = 200;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_23_4", "question": "\n    private int StatusCode;\n \n    public  static final int SUCCESS = 200;\n    ", "target": "public  static final int ERROR = 500;\n", "answers": ["public  static final int ERROR = 500;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_25_4", "question": "\n    private Map<String,Object> data = new HashMap<>();\n     public  static final int ERROR = 500;\n\n    ", "target": "private int StatusCode;\n", "answers": ["private int StatusCode;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_27_42", "question": "\n    public JsonResult init(int statusCode){\n     private int StatusCode;\n\n    private Map<String,Object> data = new ", "target": "HashMap<>();\n", "answers": ["HashMap<>();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode;", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_29_11", "question": "        this.StatusCode = statusCode;\n        return this;\n     private Map<String,Object> data = new HashMap<>();\n\n    public ", "target": "JsonResult init(int statusCode){\n", "answers": ["JsonResult init(int statusCode){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "StatusCode statusCode Override toString StatusCode data builder key data data put key data String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_30_13", "question": "        return this;\n    }\n \n    public JsonResult init(int statusCode){\n        this.", "target": "StatusCode = statusCode;\n", "answers": ["StatusCode = statusCode;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Override toString StatusCode data builder key data data put key data String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_31_8", "question": "    }\n\n     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        ", "target": "return this;\n", "answers": ["return this;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Override toString StatusCode data builder key data data put key data String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_32_0", "question": "\n    @Override\n         this.StatusCode = statusCode;\n        return this;\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Override toString StatusCode data builder key data data put key data String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_34_4", "question": "    public String toString() {\n        return \"JsonResult{\" +\n     }\n\n    ", "target": "@Override\n", "answers": ["@Override\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "toString StatusCode data builder key data data put key data String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_35_3", "question": "        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n \n    @Override\n   ", "target": " public String toString() {\n", "answers": [" public String toString() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "StatusCode data builder key data data put key data JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_36_15", "question": "                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n     @Override\n    public String toString() {\n        return ", "target": "\"JsonResult{\" +\n", "answers": ["\"JsonResult{\" +\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "StatusCode data builder key data data put key data JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_37_14", "question": "                \", data=\" + data +\n                '}';\n     public String toString() {\n        return \"JsonResult{\" +\n              ", "target": "  \"StatusCode=\" + StatusCode +\n", "answers": ["  \"StatusCode=\" + StatusCode +\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "data builder key data data put key data JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n              ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_38_14", "question": "                '}';\n    }\n         return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n              ", "target": "  \", data=\" + data +\n", "answers": ["  \", data=\" + data +\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "builder key data data put key data JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n              ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_39_3", "question": "    }\n\n                 \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n   ", "target": "             '}';\n", "answers": ["             '}';\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "builder key data data put key data JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_40_0", "question": "\n    public JsonResult builder(String key, Object data){\n                 \", data=\" + data +\n                '}';\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "builder key data data put key data JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_42_30", "question": "        this.data.put(key,data);\n        return this;\n     }\n\n    public JsonResult builder(", "target": "String key, Object data){\n", "answers": ["String key, Object data){\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        this.data.put(key,data);\n        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "data put key data", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_43_2", "question": "        return this;\n    }\n \n    public JsonResult builder(String key, Object data){\n  ", "target": "      this.data.put(key,data);\n", "answers": ["      this.data.put(key,data);\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return this;\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return this;\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return this;\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_44_2", "question": "    }\n}\n     public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n  ", "target": "      return this;\n", "answers": ["      return this;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_45_0", "question": "}\n         this.data.put(key,data);\n        return this;\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/model/JsonResult.java_46_0", "question": "         return this;\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[WelcomeData] me codegc apet server model lombok Data Data WelcomeData content icon mpegUrl String String String \n[JsonResult]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Serializable Map String Object HashMap JsonResult String JsonResult String Object", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "init toString builder", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[WelcomeData] private String content; private String icon; private String mpegUrl; \n[JsonResult]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"JsonResult{\" \"StatusCode=\" \", data=\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[WelcomeData] String String String \n[JsonResult]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[JsonResultTest] me codegc apet server model org junit Test JsonResultTest Test test System out println init JsonResult SUCCESS builder toString JsonResult \n[JsonResult]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResultTest] [test]     public  void test(){\n        System.out.println(new JsonResult().init(JsonResult.SUCCESS).builder(\"mess\", \"ok\").toString());\n    } \n[JsonResult]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>();", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[WelcomeData]  \n[JsonResult]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.model;\n\nimport lombok.Data;\n\nimport java.io.Serializable;\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author: Ding / 2019-03-22 20:19\n * @version: V1.0\n * @TODO: \u8fd4\u56de\u7ed3\u679c\u5b9e\u4f53\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Data\npublic class JsonResult implements Serializable {\n\n    private static final long serialVersionUID = -2100472103515439247L;\n\n    public  static final int SUCCESS = 200;\n    public  static final int ERROR = 500;\n\n    private int StatusCode;\n\n    private Map<String,Object> data = new HashMap<>();\n\n    public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    }\n\n    @Override\n    public String toString() {\n        return \"JsonResult{\" +\n                \"StatusCode=\" + StatusCode +\n                \", data=\" + data +\n                '}';\n    }\n\n    public JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[JsonResultTest]  \n[JsonResult]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[JsonResultTest] test \n[JsonResult]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[JsonResultTest] JsonResult \n[JsonResult]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[JsonResultTest] \"mess\" \"ok\" \n[JsonResult]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_0_11", "question": "\nimport org.springframework.context.annotation.Bean;\n package me.", "target": "codegc.apet.server.config;\n", "answers": ["codegc.apet.server.config;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_2_0", "question": "import org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\n package me.codegc.apet.server.config;\n\n", "target": "import org.springframework.context.annotation.Bean;\n", "answers": ["import org.springframework.context.annotation.Bean;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_3_11", "question": "import springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\n \nimport org.springframework.context.annotation.Bean;\nimport org.", "target": "springframework.context.annotation.Configuration;\n", "answers": ["springframework.context.annotation.Configuration;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_4_17", "question": "import springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\n import org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.", "target": "documentation.builders.ApiInfoBuilder;\n", "answers": ["documentation.builders.ApiInfoBuilder;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_5_7", "question": "import springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\n import org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport ", "target": "springfox.documentation.builders.PathSelectors;\n", "answers": ["springfox.documentation.builders.PathSelectors;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_6_31", "question": "import springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\n import springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.", "target": "builders.RequestHandlerSelectors;\n", "answers": ["builders.RequestHandlerSelectors;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_7_0", "question": "import springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\n import springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\n", "target": "import springfox.documentation.service.ApiInfo;\n", "answers": ["import springfox.documentation.service.ApiInfo;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_8_35", "question": "import springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n import springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.", "target": "DocumentationType;\n", "answers": ["DocumentationType;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_9_38", "question": "import springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n import springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.", "target": "web.plugins.Docket;\n", "answers": ["web.plugins.Docket;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_10_7", "question": "\n/**\n import springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport ", "target": "springfox.documentation.swagger2.annotations.EnableSwagger2;\n", "answers": ["springfox.documentation.swagger2.annotations.EnableSwagger2;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_23_0", "question": "@EnableSwagger2\npublic class SwaggerConfig {\n  *  </p>\n */\n", "target": "@Configuration\n", "answers": ["@Configuration\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_24_0", "question": "public class SwaggerConfig {\n    @Bean\n  */\n@Configuration\n", "target": "@EnableSwagger2\n", "answers": ["@EnableSwagger2\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_25_13", "question": "    @Bean\n    public Docket createRestApi() {\n @Configuration\n@EnableSwagger2\npublic class ", "target": "SwaggerConfig {\n", "answers": ["SwaggerConfig {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_26_2", "question": "    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n @EnableSwagger2\npublic class SwaggerConfig {\n  ", "target": "  @Bean\n", "answers": ["  @Bean\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n  ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_27_4", "question": "        return new Docket(DocumentationType.SWAGGER_2)\n                .apiInfo(apiInfo())\n public class SwaggerConfig {\n    @Bean\n    ", "target": "public Docket createRestApi() {\n", "answers": ["public Docket createRestApi() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_28_0", "question": "                .apiInfo(apiInfo())\n                .select()\n     @Bean\n    public Docket createRestApi() {\n", "target": "        return new Docket(DocumentationType.SWAGGER_2)\n", "answers": ["        return new Docket(DocumentationType.SWAGGER_2)\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_29_9", "question": "                .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n         ", "target": "       .apiInfo(apiInfo())\n", "answers": ["       .apiInfo(apiInfo())\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n         ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_30_7", "question": "                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n                .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n         return new Docket(DocumentationType.SWAGGER_2)\n                .apiInfo(apiInfo())\n       ", "target": "         .select()\n", "answers": ["         .select()\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n       ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_32_15", "question": "                .paths(PathSelectors.any())\n                .build();\n                 .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               ", "target": " .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n", "answers": [" .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "paths PathSelectors any build apiInfo title description termsOfServiceUrl version build ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_33_3", "question": "                .build();\n    }\n                 // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n                .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n   ", "target": "             .paths(PathSelectors.any())\n", "answers": ["             .paths(PathSelectors.any())\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "build apiInfo title description termsOfServiceUrl version build ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_34_9", "question": "    }\n\n                 .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n                .paths(PathSelectors.any())\n         ", "target": "       .build();\n", "answers": ["       .build();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "apiInfo title description termsOfServiceUrl version build ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n         ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_35_0", "question": "\n    private ApiInfo apiInfo() {\n                 .paths(PathSelectors.any())\n                .build();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "apiInfo title description termsOfServiceUrl version build ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_37_12", "question": "        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n     }\n\n    private ", "target": "ApiInfo apiInfo() {\n", "answers": ["ApiInfo apiInfo() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "title description termsOfServiceUrl version build ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_38_5", "question": "                // \u6587\u6863\u6807\u9898\n                .title(\"ApeTranslation API Docs v1.5\")\n \n    private ApiInfo apiInfo() {\n     ", "target": "   return new ApiInfoBuilder()\n", "answers": ["   return new ApiInfoBuilder()\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "title description termsOfServiceUrl version build", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n     ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_40_8", "question": "                // \u6587\u6863\u63cf\u8ff0\n                .description(\"https://github.com/JDode/ApeTranslationServer\")\n         return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n        ", "target": "        .title(\"ApeTranslation API Docs v1.5\")\n", "answers": ["        .title(\"ApeTranslation API Docs v1.5\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "description termsOfServiceUrl version build", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n        ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_42_30", "question": "                .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n                .version(\"v1.5\")\n                 .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n                .description(\"", "target": "https://github.com/JDode/ApeTranslationServer\")\n", "answers": ["https://github.com/JDode/ApeTranslationServer\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "termsOfServiceUrl version build", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_43_17", "question": "                .version(\"v1.5\")\n                .build();\n                 // \u6587\u6863\u63cf\u8ff0\n                .description(\"https://github.com/JDode/ApeTranslationServer\")\n                .", "target": "termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n", "answers": ["termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .version(\"v1.5\")\n               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "version build", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_44_12", "question": "                .build();\n    }\n                 .description(\"https://github.com/JDode/ApeTranslationServer\")\n                .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n            ", "target": "    .version(\"v1.5\")\n", "answers": ["    .version(\"v1.5\")\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "               .build();\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "               .build();\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "               .build();\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "build", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n            ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_45_3", "question": "    }\n}\n                 .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n                .version(\"v1.5\")\n   ", "target": "             .build();\n", "answers": ["             .build();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n   ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_46_0", "question": "}\n                 .version(\"v1.5\")\n                .build();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/SwaggerConfig.java_47_0", "question": "                 .build();\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "Docket Docket ApiInfo ApiInfoBuilder", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "createRestApi apiInfo", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainConfig] me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainConfig] [domainInterceptor]     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    } [addInterceptors] \n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    } \n[SwaggerConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n\n/**\n *\n *  @Author:  Ding / 2019-03-17 09:39\n *  @email\uff1a  coding1618@gmail.com\n *  @version: V1.0\n *  @TODO:  swagger\u914d\u7f6e\u7c7b\n *  <p>\n *      <a href=\"https://codegc.me\">to see Blog</a>\n *      <a href=\"https://github.com/JDode\">to see Github</a>\n *  </p>\n */\n@Configuration\n@EnableSwagger2\npublic class SwaggerConfig {\n    @Bean\n    public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainConfig]  \n[SwaggerConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainConfig] domainInterceptor addInterceptors \n[SwaggerConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainConfig] WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry \n[SwaggerConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainConfig] \"/**\" \n[SwaggerConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[SwaggerConfig]", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[SwaggerConfig]", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[SwaggerConfig]", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[SwaggerConfig]", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[SwaggerConfig]", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_0_30", "question": "\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\n package me.codegc.apet.server.", "target": "config;\n", "answers": ["config;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_2_17", "question": "import org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\n package me.codegc.apet.server.config;\n\nimport me.codegc.", "target": "apet.server.Interceptor.DomainInterceptor;\n", "answers": ["apet.server.Interceptor.DomainInterceptor;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_3_27", "question": "import org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\n \nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.", "target": "context.annotation.Bean;\n", "answers": ["context.annotation.Bean;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_4_7", "question": "import org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n import me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport ", "target": "org.springframework.context.annotation.Configuration;\n", "answers": ["org.springframework.context.annotation.Configuration;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_5_11", "question": "import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n import org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.", "target": "springframework.web.servlet.config.annotation.InterceptorRegistry;\n", "answers": ["springframework.web.servlet.config.annotation.InterceptorRegistry;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_6_39", "question": "\n/**\n import org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.", "target": "config.annotation.WebMvcConfigurer;\n", "answers": ["config.annotation.WebMvcConfigurer;\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_17_0", "question": "public class DomainConfig implements WebMvcConfigurer {\n\n  * </p>\n */\n", "target": "@Configuration\n", "answers": ["@Configuration\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "public class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "public class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "public class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_18_37", "question": "\n    @Bean\n  */\n@Configuration\npublic class DomainConfig implements ", "target": "WebMvcConfigurer {\n", "answers": ["WebMvcConfigurer {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_20_0", "question": "    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n public class DomainConfig implements WebMvcConfigurer {\n\n", "target": "    @Bean\n", "answers": ["    @Bean\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_21_29", "question": "        return new DomainInterceptor();\n    }\n \n    @Bean\n    public DomainInterceptor ", "target": "domainInterceptor() {\n", "answers": ["domainInterceptor() {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_22_19", "question": "    }\n\n     @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new ", "target": "DomainInterceptor();\n", "answers": ["DomainInterceptor();\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_23_0", "question": "\n    @Override\n     public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_25_4", "question": "    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n     }\n\n    ", "target": "@Override\n", "answers": ["@Override\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    ", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_26_32", "question": "        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n \n    @Override\n    public void addInterceptors(", "target": "InterceptorRegistry registry) {\n", "answers": ["InterceptorRegistry registry) {\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "registry addInterceptor domainInterceptor addPathPatterns", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_27_53", "question": "    }\n}\n     @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).", "target": "addPathPatterns(\"/**\");\n", "answers": ["addPathPatterns(\"/**\");\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "    }\n}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "    }\n}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "    }\n}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_28_0", "question": "}\n     public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n", "target": "    }\n", "answers": ["    }\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "}\n", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "}\n", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "}\n", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
{"id": "data/train/JDode/ApeTranslationServer/src/main/java/me/codegc/apet/server/config/DomainConfig.java_29_0", "question": "         registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n", "target": "}\n", "answers": ["}\n"], "ctxs": [{"title": "in_file#lines#0.5", "text": "", "score": 1.0}, {"title": "in_file#lines#0.75", "text": "", "score": 0.5}, {"title": "in_file#lines#0.25", "text": "", "score": 0.3333333333333333}, {"title": "in_file#identifiers#0.5", "text": "me codegc apet server config me codegc apet server Interceptor DomainInterceptor org springframework context annotation Bean org springframework context annotation Configuration org springframework web servlet config annotation InterceptorRegistry org springframework web servlet config annotation WebMvcConfigurer Configuration DomainConfig Bean domainInterceptor Override addInterceptors registry registry addInterceptor domainInterceptor addPathPatterns WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.25}, {"title": "sibling_file#method_names_and_bodies#0.5", "text": "[SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.2}, {"title": "sibling_file#identifiers#0.5", "text": "[SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.16666666666666666}, {"title": "in_file#type_identifiers#0.5", "text": "WebMvcConfigurer DomainInterceptor DomainInterceptor InterceptorRegistry", "score": 0.14285714285714285}, {"title": "in_file#method_names#0.5", "text": "domainInterceptor addInterceptors", "score": 0.125}, {"title": "sibling_file#field_declarations#0.5", "text": "[SwaggerConfig]  \n[DomainConfig]", "score": 0.1111111111111111}, {"title": "in_file#string_literals#0.5", "text": "\"/**\"", "score": 0.1}, {"title": "sibling_file#type_identifiers#0.5", "text": "[SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.09090909090909091}, {"title": "sibling_file#string_literals#0.5", "text": "[SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.08333333333333333}, {"title": "similar_name_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] me codegc apet server config org springframework context annotation Bean org springframework context annotation Configuration springfox documentation builders ApiInfoBuilder springfox documentation builders PathSelectors springfox documentation builders RequestHandlerSelectors springfox documentation service ApiInfo springfox documentation spi DocumentationType springfox documentation spring web plugins Docket springfox documentation swagger2 annotations EnableSwagger2 Configuration EnableSwagger2 SwaggerConfig Bean createRestApi DocumentationType SWAGGER_2 apiInfo apiInfo select apis RequestHandlerSelectors basePackage paths PathSelectors any build apiInfo title description termsOfServiceUrl version build Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.07692307692307693}, {"title": "similar_name_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } [SwaggerConfig] [createRestApi]     public Docket createRestApi() {\n        return new Docket(DocumentationType.SWAGGER_2)\n               .apiInfo(apiInfo())\n               .select()\n                // \u6307\u5b9acontroller\u5b58\u653e\u7684\u76ee\u5f55\u8def\u5f84\n               .apis(RequestHandlerSelectors.basePackage(\"me.codegc.apet.server.controller\"))\n               .paths(PathSelectors.any())\n               .build();\n    } [apiInfo] Builder()\n                // \u6587\u6863\u6807\u9898\n               .title(\"ApeTranslation API Docs v1.5\")\n                // \u6587\u6863\u63cf\u8ff0\n               .description(\"https://github.com/JDode/ApeTranslationServer\")\n               .termsOfServiceUrl(\"https://github.com/JDode/ApeTranslationServer\")\n               .version(\"v1.5\")\n               .build();\n    } \n[DomainConfig]", "score": 0.07142857142857142}, {"title": "in_file#field_declarations#0.5", "text": "", "score": 0.06666666666666667}, {"title": "sibling_file#method_names#0.5", "text": "[SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.0625}, {"title": "codex", "text": "package me.codegc.apet.server.config;\n\nimport me.codegc.apet.server.Interceptor.DomainInterceptor;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.InterceptorRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\n\n/**\n * @author: Ding / 2019-03-23 17:28\n * @version: V1.0\n * @TODO: \u767d\u540d\u5355\u57df\u540d\u914d\u7f6e\n * <p>\n * <a href=\"https://codegc.me\">to see Blog</a>\n * <a href=\"https://github.com/JDode\">to see Github</a>\n * </p>\n */\n@Configuration\npublic class DomainConfig implements WebMvcConfigurer {\n\n    @Bean\n    public DomainInterceptor domainInterceptor() {\n        return new DomainInterceptor();\n    }\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(domainInterceptor()).addPathPatterns(\"/**\");\n    }\n", "score": 0.058823529411764705}, {"title": "similar_name_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); [SwaggerConfig]  \n[DomainConfig]", "score": 0.05555555555555555}, {"title": "similar_name_file#method_names#0.5", "text": "[DomainInterceptor] preHandle [SwaggerConfig] createRestApi apiInfo \n[DomainConfig]", "score": 0.05263157894736842}, {"title": "similar_name_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult [SwaggerConfig] Docket Docket ApiInfo ApiInfoBuilder \n[DomainConfig]", "score": 0.05}, {"title": "similar_name_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" [SwaggerConfig] \"me.codegc.apet.server.controller\" \"ApeTranslation API Docs v1.5\" \"https://github.com/JDode/ApeTranslationServer\" \"https://github.com/JDode/ApeTranslationServer\" \"v1.5\" \n[DomainConfig]", "score": 0.047619047619047616}, {"title": "parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.045454545454545456}, {"title": "child_class_file#identifiers#0.5", "text": "", "score": 0.043478260869565216}, {"title": "child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.041666666666666664}, {"title": "parent_class_file#identifiers#0.5", "text": "", "score": 0.04}, {"title": "child_class_file#method_names#0.5", "text": "", "score": 0.038461538461538464}, {"title": "parent_class_file#method_names#0.5", "text": "", "score": 0.037037037037037035}, {"title": "child_class_file#type_identifiers#0.5", "text": "", "score": 0.03571428571428571}, {"title": "parent_class_file#field_declarations#0.5", "text": "", "score": 0.034482758620689655}, {"title": "parent_class_file#type_identifiers#0.5", "text": "", "score": 0.03333333333333333}, {"title": "parent_class_file#string_literals#0.5", "text": "", "score": 0.03225806451612903}, {"title": "child_class_file#string_literals#0.5", "text": "", "score": 0.03125}, {"title": "import_of_similar_name_file#identifiers#0.5", "text": "[JsonResult] me codegc apet server model lombok Data java io Serializable java util HashMap java util Map Data JsonResult serialVersionUID SUCCESS ERROR StatusCode data init statusCode StatusCode statusCode Override toString StatusCode data builder key data data put key data Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.030303030303030304}, {"title": "import_of_similar_name_file#method_names_and_bodies#0.5", "text": "[JsonResult] [init]     public JsonResult init(int statusCode){\n        this.StatusCode = statusCode;\n        return this;\n    } [toString]                 \", data=\" + data +\n                '}';\n    } [builder]  JsonResult builder(String key, Object data){\n        this.data.put(key,data);\n        return this;\n    } \n[DomainConfig]", "score": 0.029411764705882353}, {"title": "import_file#identifiers#0.5", "text": "[DomainInterceptor] me codegc apet server Interceptor com alibaba fastjson JSONObject lombok extern slf4j Slf4j me codegc apet server model JsonResult org springframework web servlet HandlerInterceptor org springframework web servlet ModelAndView javax servlet http HttpServletRequest javax servlet http HttpServletResponse java util Arrays java util HashSet java util Set Slf4j DomainInterceptor allowDomain allowedOrigins Arrays asList allowDomain Override preHandle request response handler originHeader request getHeader allowedOrigins contains originHeader response setHeader originHeader response setHeader response setHeader response setHeader response setHeader response setCharacterEncoding response getWriter println JSONObject toJSON init JsonResult ERROR builder log info request changeSessionId HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.02857142857142857}, {"title": "import_file#method_names_and_bodies#0.5", "text": "[DomainInterceptor] [preHandle]     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n        String originHeader = request.getHeader(\"Origin\");\n        if (allowedOrigins.contains(originHeader)) {\n            response.setHeader(\"Access-Control-Allow-Origin\", originHeader);\n            response.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept, Cookie\");\n            response.setHeader(\"Access-Control-Allow-Methods\", \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\");\n            response.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n            return  true;\n        }\n        response.setHeader(\"Content-type\", \"text/json;charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n        response.getWriter().println(JSONObject.toJSON(new JsonResult().init(JsonResult.ERROR).builder(\"message \",\"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\")));\n        log.info(\"This domain name is not on the white list.{}\",request.changeSessionId());\n        return false;\n    } \n[DomainConfig]", "score": 0.027777777777777776}, {"title": "import_of_similar_name_file#field_declarations#0.5", "text": "[JsonResult] private static final long serialVersionUID = -2100472103515439247L; public  static final int SUCCESS = 200; public  static final int ERROR = 500; private int StatusCode; private Map<String,Object> data = new HashMap<>(); \n[DomainConfig]", "score": 0.02702702702702703}, {"title": "import_of_similar_name_file#method_names#0.5", "text": "[JsonResult] init toString builder \n[DomainConfig]", "score": 0.02631578947368421}, {"title": "import_of_similar_name_file#string_literals#0.5", "text": "[JsonResult] \"JsonResult{\" \"StatusCode=\" \", data=\" \n[DomainConfig]", "score": 0.02564102564102564}, {"title": "import_of_sibling_file#identifiers#0.5", "text": "", "score": 0.025}, {"title": "import_of_sibling_file#method_names_and_bodies#0.5", "text": "", "score": 0.024390243902439025}, {"title": "import_file#field_declarations#0.5", "text": "[DomainInterceptor] private static String[] allowDomain = {\"http://localhost:8080\",\"*\",null}; private static Set<String> allowedOrigins = new HashSet<String>(Arrays.asList(allowDomain)); \n[DomainConfig]", "score": 0.023809523809523808}, {"title": "import_file#method_names#0.5", "text": "[DomainInterceptor] preHandle \n[DomainConfig]", "score": 0.023255813953488372}, {"title": "import_file#string_literals#0.5", "text": "[DomainInterceptor] \"http://localhost:8080\" \"*\" \"Origin\" \"Access-Control-Allow-Origin\" \"Access-Control-Allow-Headers\" \"Origin, X-Requested-With, Content-Type, Accept, Cookie\" \"Access-Control-Allow-Methods\" \"GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH\" \"Access-Control-Allow-Credentials\" \"true\" \"Content-type\" \"text/json;charset=UTF-8\" \"UTF-8\" \"message \" \"\u4f60\u7684\u57df\u540d\u6ca1\u6709\u5728\u767d\u540d\u5355\u91cc!\u8bf7\u6c42\u88ab\u62d2\u7edd!\"))); \"This domain name is not on the white list.{}\" \n[DomainConfig]", "score": 0.022727272727272728}, {"title": "import_of_sibling_file#method_names#0.5", "text": "", "score": 0.022222222222222223}, {"title": "import_of_sibling_file#field_declarations#0.5", "text": "", "score": 0.021739130434782608}, {"title": "import_of_similar_name_file#type_identifiers#0.5", "text": "[JsonResult] Serializable Map String Object HashMap JsonResult String JsonResult String Object \n[DomainConfig]", "score": 0.02127659574468085}, {"title": "import_file#type_identifiers#0.5", "text": "[DomainInterceptor] HandlerInterceptor String Set String HashSet String HttpServletRequest HttpServletResponse Object Exception String JsonResult \n[DomainConfig]", "score": 0.020833333333333332}, {"title": "import_of_sibling_file#string_literals#0.5", "text": "", "score": 0.02040816326530612}, {"title": "import_of_sibling_file#type_identifiers#0.5", "text": "", "score": 0.02}, {"title": "import_of_child_class_file#identifiers#0.5", "text": "", "score": 0.0196078431372549}, {"title": "import_of_child_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.019230769230769232}, {"title": "import_of_child_class_file#method_names#0.5", "text": "", "score": 0.018867924528301886}, {"title": "import_of_child_class_file#field_declarations#0.5", "text": "", "score": 0.018518518518518517}, {"title": "import_of_child_class_file#type_identifiers#0.5", "text": "", "score": 0.01818181818181818}, {"title": "import_of_child_class_file#string_literals#0.5", "text": "", "score": 0.017857142857142856}, {"title": "child_class_file#field_declarations#0.5", "text": "", "score": 0.017543859649122806}, {"title": "import_of_parent_class_file#identifiers#0.5", "text": "", "score": 0.017241379310344827}, {"title": "import_of_parent_class_file#method_names_and_bodies#0.5", "text": "", "score": 0.01694915254237288}, {"title": "import_of_parent_class_file#type_identifiers#0.5", "text": "", "score": 0.016666666666666666}, {"title": "import_of_parent_class_file#field_declarations#0.5", "text": "", "score": 0.01639344262295082}, {"title": "import_of_parent_class_file#string_literals#0.5", "text": "", "score": 0.016129032258064516}, {"title": "import_of_parent_class_file#method_names#0.5", "text": "", "score": 0.015873015873015872}]}
